简体   繁体   中英

What is the difference between Selenium and Mozrepl?

From what I can gather, mozrepl uses WWW::Mechanize::Firefox to automate firefox. ie. you create scripts and hit interpreted commands that shoot to the firefox browser as output.

Selenium on the other hand lets you record actions in the browser, and you can output the actions as scripts in various languages.

So essentially, mozrepl takes scripts (fragments) as input and outputs as browser actions. Selenium takes browser actions and outputs them as a script.

Or can they both perform these function? Am I on the right track?

You have misunderstood MozRepl and WWW::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.

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. There is also a MozRepl Perl module that connects to the extension in the same way but provides a different API.

The selenium generated scripts can then be run, so it does perform both functions.

You have it backwards; WWW::Mechanize::Firefox uses mozrepl, not the other way around.

Selenium is implemented in javascript on the browser and supports multiple browsers; 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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