• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 190
  • Last Modified:

Browser Status from Perl

I am looking to launch opera from a perl script. This part I have done:

system ("opera $ARGV[0]");

I want the script to wait until the page is done loading, and then do something else. The problem is that I don't know how to get the status out of opera. Does anyone know how to do this? I am presently using a sleep command, but that is not good enough for my application.

I thought of using the following line:

$browser_status  = system ("opera $ARGV[0]");

But, browser status comes back as a 0 before the browser loads anything.

Basically I want to do two things:

1.) Have the script wait until the page is done loading in the browser.

2.) Have the script be aware if there was a problem loading the script. (If possible) I know this is possible with lwp, but for what I am looking to do, lwp will not work. Now, if it is not possible to get opera to admit there was a problem with the page, I can use lwp to see if the page returns an error. But I would like to just use opera...

Any ideas?
0
stakor
Asked:
stakor
  • 3
  • 2
1 Solution
 
kanduraCommented:
I don't think Opera will give you that information through its STDOUT.
I tried this:

    $ret = `opera $ARGV[0]`;
    print $ret;

but all I got was:

    AssignInterface
    VXMLPlugin::PrepareToSend 2

What is it you're trying to do, and why do you think it can't be done with lwp?
Have a look at WWW::Mechanize.
0
 
stakorAuthor Commented:
I am trying to create a screenshot of a site. I was using opera, and Image::Magick to do this. I am unaware of anything that is in lwp that would allow me to do this. (Though, I will look up WWW::Mechanize)  The idea is to go through a list of sites, and take a snapshot of them. Is this something that could be done with WWW::Mechanize?
0
 
kanduraCommented:
I know this question has come up in the past. Let me see if I can find a reference to it.
0
 
kanduraCommented:
0
 
stakorAuthor Commented:
I was hoping that it would go differently, but I guess there is no easy way to do it. The points will go to the best answer. (Only Answer)
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now