自动Web浏览 [英] Automated web browing

查看:108
本文介绍了自动Web浏览的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




有没有人知道如何在一页上输入一些文字进入输入框,而不是按下该页面上的某个按钮,加载另一个

页面,最后阅读回复?假设我想写一个价格

比较引擎,我想在每次用户需要的时候解析商店网站

的价格。


我在Symfony框架中找到了类似的功能,称为sfBrowser

(或sfTestBrowser)。这些是用于自动功能测试,

但应提供我要求的功能。


问题是:这是否足够有效?也许有其他

方法来实现这个目标?当然我总是可以尝试手动设置更多

- 在网址中查找一些模式(搜索通常通过

GET完成),并解析输出html。 />

感谢您的帮助

Marcin

Hi

Does anybody have some idea how to input some text into inputbox on
one page, than press some button on that page, that will load another
page, and finally read the responde? Suppose I want to write a price
comparision engine, where I would like to parse shops website for
price each time user wants.

I have found similar feature in Symfony framework, called sfBrowser
(or sfTestBrowser). These are made for automated functional testing,
but should provide the functinality I am requesting.

The question is: will this be efficient enough? Maybe there are other
ways to achieve this? Of course I can always try to make it more
manually - look for some pattern in url (search is usually done via
GET), and parse output html.

Thanks for help
Marcin

推荐答案

于01/17/2008 07 :52 PM mr_marcin说如下:
on 01/17/2008 07:52 PM mr_marcin said the following:




有没有人知道如何在输入框中输入一些文字

一页,比按下该页面上的某个按钮,这将加载另一个

页面,最后读取响应?假设我想写一个价格

比较引擎,我想在每次用户需要的时候解析商店网站

的价格。


我在Symfony框架中找到了类似的功能,称为sfBrowser

(或sfTestBrowser)。这些是用于自动功能测试,

但应提供我要求的功能。


问题是:这是否足够有效?也许有其他

方法来实现这个目标?当然我总是可以尝试使其更加手动 - 在网址中查找一些模式(搜索通常通过

GET完成),并解析输出html。
Hi

Does anybody have some idea how to input some text into inputbox on
one page, than press some button on that page, that will load another
page, and finally read the responde? Suppose I want to write a price
comparision engine, where I would like to parse shops website for
price each time user wants.

I have found similar feature in Symfony framework, called sfBrowser
(or sfTestBrowser). These are made for automated functional testing,
but should provide the functinality I am requesting.

The question is: will this be efficient enough? Maybe there are other
ways to achieve this? Of course I can always try to make it more
manually - look for some pattern in url (search is usually done via
GET), and parse output html.



您可能想尝试此HTTP客户端类。基本上它就像一个

浏览器访问页面,提交表单,收集cookie,处理

重定向等等,这似乎是你需要检索页面的

你想要的价格。

http:/ /www.phpclasses.org/httpclient

-


问候,

Manuel Lemos


寻找PHP工作的PHP专业人员
http:/ /www.phpclasses.org/professionals/

PHP类 - 免费准备使用用PHP编写的OOP组件
http://www.phpclasses.org/

You may want to try this HTTP client class. Basically it acts like a
browser accessing pages, submitting forms, collecting cookies, handling
redirection, etc. which seems what you need to retrieve the pages with
the prices you want to grab.

http://www.phpclasses.org/httpclient
--

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/


mr_marcin写道:
mr_marcin wrote:




有没有人知道如何在输入框中输入一些文字

一页,比按下该页面上的某个按钮,这将加载另一个

页面,最后读取响应?假设我想写一个价格

比较引擎,我想在每次用户需要的时候解析商店网站

的价格。


我在Symfony框架中找到了类似的功能,称为sfBrowser

(或sfTestBrowser)。这些是用于自动功能测试,

但应提供我要求的功能。


问题是:这是否足够有效?也许有其他

方法来实现这个目标?当然我总是可以尝试手动设置更多

- 在网址中查找一些模式(搜索通常通过

GET完成),并解析输出html。 />

感谢您的帮助

Marcin
Hi

Does anybody have some idea how to input some text into inputbox on
one page, than press some button on that page, that will load another
page, and finally read the responde? Suppose I want to write a price
comparision engine, where I would like to parse shops website for
price each time user wants.

I have found similar feature in Symfony framework, called sfBrowser
(or sfTestBrowser). These are made for automated functional testing,
but should provide the functinality I am requesting.

The question is: will this be efficient enough? Maybe there are other
ways to achieve this? Of course I can always try to make it more
manually - look for some pattern in url (search is usually done via
GET), and parse output html.

Thanks for help
Marcin



cURL将允许您获取或发布到页面,以及将返回数据。

我比HTTPClient类更喜欢它。它更灵活。


-

==================
删除x来自我的电子邮件地址

Jerry Stuckle

JDS计算机培训公司
js ******* @ attglobal.net

==================

cURL will allow you to get or post to pages, and will return the data.
I much prefer it over the HTTPClient class. It''s more flexible.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================


mr_marcin写道:
mr_marcin wrote:




有没有人有一些想法如何在一个页面上输入一些文本进入输入框,而不是按下该页面上的某个按钮,这将加载另一个

页面,最后读取响应?假设我想写一个价格

比较引擎,我想在每次用户需要的时候解析商店网站的价格为

Hi

Does anybody have some idea how to input some text into inputbox on
one page, than press some button on that page, that will load another
page, and finally read the responde? Suppose I want to write a price
comparision engine, where I would like to parse shops website for
price each time user wants.



你好,


SimpleTest有一个名为SimpleBrowser的类,它可以做什么

你想要的,有一个非常直观的API。这不是太快......


SimpleTest: http://www.lastcraft.com/simple_test.php


或者,您可以使用Selenium IDE以交互方式设置浏览会话

然后使用PHP客户端运行Selenium Remote Control ...


Selenium IDE: http://www.openqa.org/selenium-ide/

Selenium RC: http://www.openqa.org/selenium-rc/

Selenium的PHP客户端: http://pear.php.net/package/ Testing_Selenium


其他:
http://blog.thin kphp.de/archives/133...-Selenium.html

问候,

马林福布斯

自由开发者

数据萨满

datashaman.com

+27(0)82 501-6647

Hi there,

SimpleTest has a class included called SimpleBrowser, which does what
you want, with a very intuitive API. It''s not too fast tho...

SimpleTest: http://www.lastcraft.com/simple_test.php

Or, you can interactively setup browsing sessions with the Selenium IDE
and then use the PHP client for the Selenium Remote Control to run them...

Selenium IDE: http://www.openqa.org/selenium-ide/
Selenium RC: http://www.openqa.org/selenium-rc/
PHP Client for Selenium: http://pear.php.net/package/Testing_Selenium

Misc:
http://blog.thinkphp.de/archives/133...-Selenium.html
Regards,
Marlin Forbes
Freelance Developer
Data Shaman
datashaman.com
+27 (0)82 501-6647


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

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