python - 如何使用python抓取javascript生成的html?

标签 python

我想抓取 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/

相关文章:

python - 如何映射具有相同索引的 2 个 numpy 数组

python - 有没有办法改变乌龟中文本框的位置?它总是显示在左上角,但我希望它位于底部中央

python - 如何 JSON 序列化 Pydantic BaseModel 中的 ENum 类

python - 使用 class_weight 来不平衡数据-.fit_generator()

python - 值错误 : `Concatenate` layer requires inputs with matching shapes except for the concat axis

python - 如何手动使用 make_password 和 check_password?

python - 在 Networkx 中更改节点显示大小

python - 使用 FuncAnimation 为 Seaborn 气泡图制作动画

python - 使用 matplotlib.animate 在 python 中对等高线图进行动画处理

python - 导入错误 : cannot import name 'PY2'