Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: How to handle a browser window that opens up during the execution of some external program commands

by hdb (Prior)
on Mar 28, 2013 at 13:35 UTC ( #1025967=note: print w/ replies, xml ) Need Help??


in reply to How to handle a browser window that opens up during the execution of some external program commands

I am on Internet Explorer and found Win32::IEAutomation useful in the past as it emulates the user interaction with the browser. Have a look at the code snippet below. This is a bit older code and I hope it still works on newer IE.

my $ie = Win32::IEAutomation->new( visible => 1 ); $ie->gotoURL( "http://some.site.com/" ); # login $ie->getTextBox('name:', "userid")->SetValue($user); $ie->getTextBox('name:', "password")->SetValue($pass); $ie->getButton('name:', "login.x")->Click; # move to job page $ie->getLink('linktext:', "Job")->Click; $ie->getLink('linktext:', $jobid)->Click; # retrieve results my $content = $ie->PageText;


Comment on Re: How to handle a browser window that opens up during the execution of some external program commands
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2015-07-31 11:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (276 votes), past polls