带有JS支持的Python浏览器模拟器 [英] Python browser emulator with JS support

查看:412
本文介绍了带有JS支持的Python浏览器模拟器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从某个站点获取一些数据.通常,我将mechanize用于此类操作,但是现在该站点使用JS来提供数据. <,mechanize不支持.

I want to grab some data from a site. Usually I use mechanize for such things, but now the site gives the data with JS. Alas, mechanize doesn't support it.

我可以用什么代替?

推荐答案

以下是一些选项:

  1. ( PhantomJS
  2. 结合使用
  1. Selenium (tutorial)
    • For headless automation, Selenium can be used in conjunction with PhantomJS

以下是一些代码示例:

  • PyQt4 + WebKit
  • An example using PyQt4+WebKit, and redone with Selenium

这篇关于带有JS支持的Python浏览器模拟器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆