我想抓取 javascript 生成的 html,就像你在 Firebug 中看到的那样。
更新: 我找到了这篇文章:http://blog.motane.lu/2009/07/07/downloading-a-pages-content-with-python-and-webkit/它使用 PyQt 来解决问题,对我来说效果很好。
但是另一个问题出现了:我必须先登录网站,但我不知道如何在 PyQt 中模拟登录.... :(
最佳答案
看看this article其中描述了使用 Windmill在浏览器执行 Javascript 后抓取页面。
This article will show how to extract the desired information using the same three steps when the web page is not written directly using HTML, but is auto-generated using JavaScript to update the DOM tree.
他们有一些示例,我相信您可以轻松适应。
关于python - 如何使用python抓取javascript生成的html?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2707108/