Controlling a browser from Python

Posted by Noio on Stack Overflow See other posts from Stack Overflow or by Noio
Published on 2010-06-13T21:15:08Z Indexed on 2010/06/13 21:22 UTC
Read the original article Hit count: 176

Filed under:
|
|
|
|

I am looking for a way to control a browser from Python, i.e. fill out form fields and submit them, possibly call JS functions. I've looked around a bit, but as far as I could see PyWebKitGtk only lets you show the browser as a GUI element, not interface with it.

Is there a way to do this easily? I wrote my program logic in Python, and I would hate to port it to JS. Besides that, even if I'd use pure JS "bookmarklets", those wouldn't be able to read/write to my local filesystem, would they?

P.S. to quell your suspicions, I'm not trying to automatically fill out forum account creation forms or something similarly spammious, though the task is technically similar. I need to crawl/scrape sites for my research project.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about python