Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Perl2exe conversion help

by Sathishkumar (Scribe)
on Nov 18, 2015 at 07:36 UTC ( #1147977=note: print w/replies, xml ) Need Help??


in reply to Re: Perl2exe conversion help
in thread Perl2exe conversion help

#perl2exe_include "HTTP/Message.pm"; #perl2exe_include "Encode/Locale.pm"; #perl2exe_include "parent.pm"; #perl2exe_include "URI/_foreign.pm"; #perl2exe_include "URI/_generic.pm"; #perl2exe_include "URI/_query.pm"; #perl2exe_include "HTTP/Cookies.pm"; #perl2exe_include "URI.pm"; print "Start \n"; use strict; use URI::_foreign; use URI::_generic; use POSIX; use HTTP::Cookies; use LWP::UserAgent; use HTML::Entities; use WWW::Mechanize; use URI::Escape; use LWP::Simple; use Encode::Byte; use URI; # require URI::_foreign; print "Start 1\n"; my $ua = LWP::UserAgent->new(show_progress=>1); $ua->agent("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/2010010 +1 Firefox/26.0"); $ua->timeout(30); $ua->cookie_jar({}); my $filename ="indiegogo"; my $cookie_file = $filename."_cookie.txt"; unlink($cookie_file); print "Start 2\n"; my $cookie = HTTP::Cookies->new(file=>$cookie_file,autosave=>1); $ua->cookie_jar($cookie); my $url = 'https://www.bing.com/search?q=ALLIANCE+BOOTS+wikipedia&qs=n +&form=QBRE&pq=alliance+boots+wikipedia&sc=1-24&sp=-1&sk=&cvid=745e119 +49da642d586c3e20bead13e60'; my ($req,$res); $req = HTTP::Request->new(GET=>$url); $req->header("Host"=>"www.bing.com"); $req->header("Accept"=>"text/html,application/xhtml+xml,application/xm +l;q=0.9,*/*;q=0.8"); $req->header("Content-Type"=>"application/x-www-form-urlencoded"); $res = $ua->request($req); $cookie->extract_cookies($res); $cookie->save; $cookie->add_cookie_header($req); print "url :: $url"; my $code = $res->code(); print $code,"\n"; if($code =~ m/50/is) { sleep 1000; goto REPEAT; } my $content = $res->content(); open sr,">narva.html"; print sr $content; close sr; exit;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1147977]
help
Chatterbox?
[1nickt]: Yes, in my (very) limited experience with it, it seems better suited to API building

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2017-11-24 14:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (349 votes). Check out past polls.

    Notices?