PyQt4:触发点击 JavaScript 链接

发布于 2024-11-24 23:28:15 字数 380 浏览 7 评论 0原文

我正在尝试用 Python 抓取一些网页,其中的信息是由 Javascript 生成的。

我设法使用带有 PyQt4 的无头浏览器检索页面加载时生成的信息(示例如下: http://blog.motane.lu/2009/07/07/downloading-a-pages-content-with-python-and-webkit/

但是现在,我正在尝试检索通过让用户单击 Javascript 链接生成的一些信息。

我怎样才能做到这一点?

谢谢

I am trying to scrape some web pages in Python were the information is generated by Javascript.

I managed to retrieve the information generated on page load by using a headless browser with PyQt4 (example here: http://blog.motane.lu/2009/07/07/downloading-a-pages-content-with-python-and-webkit/)

But now, I'm trying to retrieve some information that is generated by having the user click on a Javascript link.

How can I do that?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

老娘不死你永远是小三 2024-12-01 23:28:15

我想您需要表单提取器示例。诀窍在于您可以将任何 python 对象公开给 javascript 并调用其方法。这个例子的 Pytonic 版本可以在 PyQt 发行版中找到。

I guess you need Form Extractor Example. The trick is that you can expose any python object to javascript and call its methods. Pytonic version of this example could be found in PyQt distribution.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文