Programmatic Python Browser with JavaScript

Claudiu picture Claudiu · Dec 16, 2009 · Viewed 17.1k times · Source

I want to screen-scrape a web-site that uses JavaScript.

There is mechanize, the programmatic web browser for Python. However, it (understandably) doesn't interpret javascript. Is there any programmatic browser for Python which does? If not, is there any JavaScript implementation in Python that I could use to attempt to create one?

Answer

Annie picture Annie · Dec 16, 2009

You might be better off using a tool like Selenium to automate the scraping using a web browser, so the JS executes and the page renders just like it would for a real user.