Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: Browsing with WWW::Mechanize

by Marshall (Canon)
on Dec 29, 2022 at 11:33 UTC ( [id://11149185]=note: print w/replies, xml ) Need Help??


in reply to Re: Browsing with WWW::Mechanize
in thread Browsing with WWW::Mechanize

WWW::Mechanize is not a browser like Firefox, Chrome, etc. There is no graphical U/I for you to fiddle with. However, Mechanize is impersonating a browser (like Firefox, Chrome, etc) and collecting all of the HTML stuff that would be displayed in the browser. You can write Perl code that is filling out and submitting a form, clicking on a link, etc. But there is no actual mouse movements or clicks involved. Note that this means that https://www.700credit.com/ thinks that it is indeed talking to a browser. As an aside, there are ways to have Mechanize impersonate different browsers and sometimes this is useful because some websites dynamically change the pages that they serve up according to the type and version of browser they are talking to. That is an advanced topic, but be aware that this is possible.

As long as the website is serving up plain HTML, everything is fine and it is possible to write Perl code to interact with the site. However some sites send JavaScript to the browser for it to execute. Mechanize cannot execute JS code. The answer to that is to use Mechanize to control an actual browser and have the browser execute the JS code. This requires that the browser have a special interface so that Mechanize can control it. At the moment, I think this is only available on Chrome. Firefox took it out for security reasons.

At the moment, I and probably we don't understand what your overall objective is? Maybe you could explain more?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11149185]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2024-04-25 10:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found