简体   繁体   English

Selenium和Mozrepl有什么区别?

[英]What is the difference between Selenium and Mozrepl?

From what I can gather, mozrepl uses WWW::Mechanize::Firefox to automate firefox. 从我可以收集的内容来看,mozrepl使用WWW :: Mechanize :: Firefox来自动化firefox。 ie. 即。 you create scripts and hit interpreted commands that shoot to the firefox browser as output. 你创建脚本并点击解释的命令,作为输出射击到firefox浏览器。

Selenium on the other hand lets you record actions in the browser, and you can output the actions as scripts in various languages. 另一方面,Selenium允许您在浏览器中记录操作,并且可以将操作作为脚本以各种语言输出。

So essentially, mozrepl takes scripts (fragments) as input and outputs as browser actions. 基本上,mozrepl将脚本(片段)作为输入和输出作为浏览器操作。 Selenium takes browser actions and outputs them as a script. Selenium接受浏览器操作并将其作为脚本输出。

Or can they both perform these function? 或者他们都可以执行这些功能吗? Am I on the right track? 我是在正确的轨道上吗?

You have misunderstood MozRepl and WWW::Mechanize::Firefox . 您误解了MozReplWWW::Mechanize::Firefox Mozrepl is an extension to Firefox that provides a telnet interface (by default on port 4242) that offers direct access to the internal functions of Firefox's Gecko engine including the Document Object Model of each window. Mozrepl是Firefox的扩展,它提供了一个telnet接口(默认情况下在端口4242上),可以直接访问Firefox Gecko引擎的内部功能,包括每个窗口的文档对象模型。

This interface can be used directly at a console or driven by software such as the Perl WWW::Mechanize::Firefox module, which presents an interface similar to the WWW::Mechanize module. 该接口可以直接在控制台上使用,也可以由Perl WWW::Mechanize::Firefox模块等软件驱动,该模块提供类似于WWW::Mechanize模块的接口。 There is also a MozRepl Perl module that connects to the extension in the same way but provides a different API. 还有一个MozRepl Perl模块以相同的方式连接到扩展,但提供了不同的API。

The selenium generated scripts can then be run, so it does perform both functions. 然后可以运行selenium生成的脚本,因此它确实执行这两个功能。

You have it backwards; 你倒退了; WWW::Mechanize::Firefox uses mozrepl, not the other way around. WWW :: Mechanize :: Firefox使用mozrepl,而不是相反。

Selenium is implemented in javascript on the browser and supports multiple browsers; Selenium在浏览器上用javascript实现,支持多种浏览器; it is usually used for testing. 它通常用于测试。

WWW::Mechanize::Firefox, on the other hand, is usually used for scraping or to perform some action needing a browser, not testing. 另一方面,WWW :: Mechanize :: Firefox通常用于抓取或执行需要浏览器的某些操作,而不是测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM