4

Basically, I want to be able to mimic the functions of an internet browser, but without having to actually graphically render it. My ideal scenario would be, for example, a script which opens a connection with a webpage, makes all the necessary calls and interactions, and can list what javascript went off (this is a trivial example, but is the sort of thing I'm looking for). I basically want to be able to "browse" from python while logging various events that happen. The real dream would be able to program in reactions (such as sending a click if there's a box that looks like this or that, for example).

Is there a nice way to do this? Thank you.

1
  • 1
    Have a look at mechanize. Commented May 6, 2011 at 20:27

2 Answers 2

3

You should check out twill. It works on the command line but also has a python api.

Sign up to request clarification or add additional context in comments.

Comments

3

You might want to check out PhantomJS. You script it in JavaScript rather than Python, but it seems to be a nice headless browser based on WebKit.

Another option might be to use Selenium, which has a Python binding available for it too: http://pypi.python.org/pypi/selenium

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.