html + javascript自动化= [机械化+ ?? ] 或者是其他东西? [英] html + javascript automations = [mechanize + ?? ] or something else?

查看:79
本文介绍了html + javascript自动化= [机械化+ ?? ] 或者是其他东西?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我必须为使用html + javascript的网页编写一个spyder。我用b / b
用机械化写的

但网页的作者现在使用了大量的javascript。机械化

再也无法完成这项工作。

有谁知道如何让我的spyder自动理解

javascript?有没有办法

从python本身控制像firefox这样的浏览器? IE怎么样?

这样,我们没有

来通过机械化这样的东西?


提前致谢你的帮助/意见,

--j


I have to write a spyder for a webpage that uses html + javascript. I
had it written using mechanize
but the authors of the webpage now use a lot of javascript. Mechanize
can no longer do the job.
Does anyone know how I could automate my spyder to understand
javascript? Is there a way
to control a browser like firefox from python itself? How about IE?
That way, we do not have
to go thru something like mechanize?

Thanks in advance for your help/comments,
--j

推荐答案



我我很好奇webbrowser模块。我可以使用webbrowser.open()打开firefox

,但可以控制它吗?比如在网页上输入

登录/密码?发送键盘给firefox?

鼠标点击?


谢谢,

--j


John写道:

I am curious about the webbrowser module. I can open up firefox
using webbrowser.open(), but can one control it? Say enter a
login / passwd on a webpage? Send keystrokes to firefox?
mouse clicks?

Thanks,
--j

John wrote:

我必须为使用html + javascript的网页编写一个spyder。我用b / b
用机械化写的

但网页的作者现在使用了大量的javascript。机械化

再也无法完成这项工作。

有谁知道如何让我的spyder自动理解

javascript?有没有办法

从python本身控制像firefox这样的浏览器? IE怎么样?

这样,我们没有

来通过机械化这样的东西?


提前致谢您的帮助/意见,

--j
I have to write a spyder for a webpage that uses html + javascript. I
had it written using mechanize
but the authors of the webpage now use a lot of javascript. Mechanize
can no longer do the job.
Does anyone know how I could automate my spyder to understand
javascript? Is there a way
to control a browser like firefox from python itself? How about IE?
That way, we do not have
to go thru something like mechanize?

Thanks in advance for your help/comments,
--j


您好,


John写道:
Hello,

John wrote:

John写道:
John wrote:

>我必须为使用的网页编写一个spyder html + javascript。我使用机械化编写了
但网页的作者现在使用了大量的javascript。机械化
已经无法完成这项工作。
有谁知道如何让我的spyder自动理解
javascript?有没有办法从python本身控制像firefox这样的浏览器? IE怎么样?
那样,我们没有机械化的东西去?
>I have to write a spyder for a webpage that uses html + javascript. I
had it written using mechanize
but the authors of the webpage now use a lot of javascript. Mechanize
can no longer do the job.
Does anyone know how I could automate my spyder to understand
javascript? Is there a way
to control a browser like firefox from python itself? How about IE?
That way, we do not have
to go thru something like mechanize?



我对webbrowser模块很好奇。我可以使用webbrowser.open()打开firefox

,但可以控制它吗?比如在网页上输入

登录/密码?发送击键给firefox?

鼠标点击?


I am curious about the webbrowser module. I can open up firefox
using webbrowser.open(), but can one control it? Say enter a
login / passwd on a webpage? Send keystrokes to firefox?
mouse clicks?



不使用webbrowser模块 - 它只能启动浏览器。


在机械化网站上你也会发现DOMForm

< http://wwwsearch.sourceforge.net/DOMForm/> ;,这是一个带有

基本JS支持的webscraper(使用Mozilla的SpiderMonkey引擎)项目)。

但请注意,DOMForm处于早期状态并且不再开发

(根据网站,从未使用过它)。


您可以尝试使用COM编写IE脚本(也许也是FF,dunno ..)。这可以是使用pywin32模块完成的
< https://sourceforge.net/projects/pywin32/>。

如何详细完成这是一个窗口问题。您可以在win特定组/邮件列表中找到帮助和

文档,msdn,...您通常可以

从VB转换COM调用,C#,...非常直接的Python。

HTH


-

Benjamin Niemann

电子邮件:粉红色odahoda dot de

WWW: http://pink.odahoda.de/


John,

" J" == John写道:


JI必须为使用html + javascript的网页编写一个spyder。我用
jhad用机械化编写,但网页的作者现在使用了一个javascript的j $ b $ j jlot。机械化无法再完成这项工作。有没有人

我知道如何自动化我的spyder来理解javascript?有没有

Ja方式从python本身控制像firefox这样的浏览器?怎么样

杰?那样的话,我们不需要通过机械化这样的东西吗?


据我所知,没有办法测试javascript但是要启动一个

浏览器。


因此,您可以查看Selenium( http://www.openqa.org/selenium/ )及其

python模块。


-

Andrey V Khavryuchenko

软件开发公司 http:// www .kds.com.ua /
John,

"J" == John wrote:

JI have to write a spyder for a webpage that uses html + javascript. I
Jhad it written using mechanize but the authors of the webpage now use a
Jlot of javascript. Mechanize can no longer do the job. Does anyone
Jknow how I could automate my spyder to understand javascript? Is there
Ja way to control a browser like firefox from python itself? How about
JIE? That way, we do not have to go thru something like mechanize?

Up to my knowledge, there no way to test javascript but to fire up a
browser.

So, you might check Selenium (http://www.openqa.org/selenium/) and its
python module.

--
Andrey V Khavryuchenko
Software Development Company http://www.kds.com.ua/


这篇关于html + javascript自动化= [机械化+ ?? ] 或者是其他东西?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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