The documentation shows examples of how to use the module. Show us your code or tell us what sites you want to query for what and we might help you further.
Just note, unlike modern browsers, WWW::Mechanize doesn't support JavaScript. For that, you might need to switch to WWW::Mechanize::Chrome.
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
| [reply] [d/l] |
use WWW::Mechanize;
my $mech = WWW::Mechanize->new();
$mech->get("https://www.700credit.com/zeus/");
$mech->dump_forms();
$mech->find_all_inputs();
Running these 5 lines of code, I am attaching to the website and I am receiving all of the fields in the command prompt window. But no Browser. Do I need to declare what Browser I want to use? Do I need to attach the Browser? This is where my level of confusion stands...Help!
| [reply] [d/l] |
It sounds like yeours expecting to see a web browser open up, this isn't what the module does. If you want to automate an actual browser see WWW::Mechanize::Chrome.
| [reply] |
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?
| [reply] [d/l] |