login - Site scraping in perl using WWW::Mechanize -


I used the WWW :: Mechanize in Pearl for the site scrapping application.

I have some difficulties when I am going to log on to a particular site via WWW :: Mechanize. I have gone through some examples of WWW :: Mechanize but I could not find my issue. I've mentioned your code below.

  #! Use / usr / bin / perl -w hard; Use WWW :: MacNet; HTTP :: Use cookies; Use Crypt :: SSLeay; My $ agent = WWW :: mechanism- & gt; New (noproxy = & gt; 0); $ Agent & gt; Cookie_jar (HTTP :: Cookies-> New ()); $ Agent & gt; Agent ('Mozilla / 5.0'); $ Agent- & gt; Proxy (['https', 'http', 'ftp'], 'http://proxy.rcapl.com:3128'); $ Agent & gt; Get ("http://www.facebook.com"); My $ re = $ agent- & gt; Submit_form (form_number = & gt; 1, field = & gt; {email = & gt; 'xyz@gmail.com', password => 'xyz'}); Print $ re- & gt; material ();   

When I run the code it says:

Error posting: but not applicable. / Test.pl Line 11

Can someone tell me what is going wrong on the code? Do I need to set all the parameters that send for Facebook login?

The proxy is faulty:

  http: //www.facebook Error getting .com: can not connect to proxy.rcapl.com: 3128 (bad hostname) so11406791.pl on line 11.   

without calling the program proxy method Works for me to remove it.

Comments