编程Python的浏览器使用JavaScript [英] Programmatic Python Browser with JavaScript
问题描述
我想屏幕刮即使用JavaScript的Web站点。
I want to screen-scrape a web-site that uses JavaScript.
有 ,程序化的Web浏览器为Python。但是,它(可以理解)不跨$ P $磅的JavaScript。有没有为Python这确实任何编程浏览器?如果没有,有没有在Python任何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?
推荐答案
您可能会更好使用像硒一个工具来自动刮使用网络浏览器,所以对JS执行和页面呈现就像它会为一个真正的用户。
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.
这篇关于编程Python的浏览器使用JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!