机械化和Javascript [英] Mechanize and Javascript

查看:154
本文介绍了机械化和Javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用机械化来模拟浏览到一个网页与JavaScript的活跃,包括DOM事件和AJAX,到目前为止,我发现没有办法做到这一点。

I want to use Mechanize to simulate browsing to a web page with active JavaScript, including DOM Events and AJAX, and so far I've found no way to do that.

在支持JavaScript像Spynner和Zope中,一些Python客户端浏览器Ilooked,没有人真的为我工作。 Spynner崩溃PyQt的所有的时间和它似乎Zope的不支持JavaScript。

Ilooked at some Python client browsers that support JavaScript like Spynner and Zope, and none of them really work for me. Spynner crashes PyQt all the time and Zope doesn't support JavaScript as it seems.

有没有一种方法来模拟与Python浏览而已,操纵Firefox或IE浏览器,同时完全支持Javascript中,竟仿佛浏览的页面没有多余的过程,喜欢的Watir或库?

Is there a way to simulate browsing with Python only, no extra processes, like WATIR or libraries that manipulate Firefox or Internet Explorer, while supporting Javascript fully, as if actually browsing the page?

推荐答案

我已经用这个新的替代发挥机械化(我的爱)呼吁幻影JS

I've played with this new alternative to Mechanize (which I love) called Phantom JS.

这是如Safari或Chrome一个完整的Web浏览器套件,但无头和编写脚本。你用JavaScript,而不是Python(据我所知至少)。

It is a full web kit browser like Safari or Chrome but is headless and scriptable. You script it with javascript, not python (as far as I know at least).

有一些示例脚本,让你开始。这就像使用Firebug很多。我只花了几分钟使用它,但我发现我从一开始就非常富有成效的权利。

There are some example scripts to get you started. It's a lot like using Firebug. I've only spent a few min using it but I found I was quite productive right from the start.

这篇关于机械化和Javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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