in reply to Re: creating a useful browser from automation
in thread creating a useful browser from automation
The reason I went with a system call is that it was in code I encountered after I made the original post. Also, I hadn't been able to make HTML::Display work with my meager experience. It turns out, that your script runs just fine on my Windows 8 machine:
#!/usr/bin/perl use strict; use warnings; use WWW::Mechanize; use HTML::Display; $ENV{'PERL_HTML_DISPLAY_COMMAND'}='run "C:\Program Files (x86)\Google\ +Chrome\Application\chrome.exe" %s'; my $base_url = 'https://www.huntington.com/'; my $spider = WWW::Mechanize->new( autocheck => 1 ); $spider->get( $base_url ); die( "$base_url: " . $spider->response->status_line ) unless $spider-> +success; my $browser = HTML::Display->new(); $browser->display( html => $spider->content( base_href => $base_url ) +); __END__
So it is that I have to admit that I have another error from the original post, namely that HTML::Display seems to work fine as long as it's called correctly, in particular, with a base_url properly specified.
I have to attend to the pesky invasion of real life, so I'll leave it with that.
|
|---|