Does your network require a proxy setting?

If your default browser is internet explorer, take a look at (rough translation from german language): Extras, Internet Options, Connections. If you have any VPN- or Dial-out connections, check them for Proxy settings. Also check in "LAN Settings" if you have any "automatic proxy settings".

You can also check if you can connect to google via your telnet client (manual HTTP connection). Open cmd.exe and connect to google:

telnet www.google.com 80
Then, type
GET /
(you might not see anything) and press Enter twice. Depending on your physical location, you should see something similar to
HTTP/1.0 302 Found Location: http://www.google.at/ Cache-Control: private Content-Type: text/html; charset=UTF-8 Set-Cookie: PREF=ID=47392c3f5731cea0:FF=0:TM=1335443806:LM=1335443806: +S=cuyFu3S3rkcsl_Do; expires=Sat, 26-Apr-2014 12:36:46 GMT; path=/; do +main=.google.com Set-Cookie: NID=59=UfWRVat2ENDZmUrEV_XafYqLpl5-5DpsARihwnhqliVswI9X2DV +ABcF8Cmcx2q6TCQp7KQIPIqVx9iZPH3XRm3g-jtRz6fFry__EOSQKY2XNd7QtoZPopMjT +OR5HmTBU; expires=Fri, 26-Oct-2012 12:36:46 GMT; path=/; domain=.goog +le.com; HttpOnly P3P: CP="This is not a P3P policy! See http://www.google.com/support/a +ccounts/bin/answer.py?hl=en&answer=151657 for more info." Date: Thu, 26 Apr 2012 12:36:46 GMT Server: gws Content-Length: 218 X-XSS-Protection: 1; mode=block X-Frame-Options: SAMEORIGIN <HTML><HEAD><meta http-equiv="content-type" content="text/html;charset +=utf-8"> <TITLE>302 Moved</TITLE></HEAD><BODY> <H1>302 Moved</H1> The document has moved <A HREF="http://www.google.at/">here</A>. </BODY></HTML>

If you see something completly different that looks like a message from your local proxy, you will have to add the correct proxy settings to your script. I never had to do this, but from a quick glance into the documentation, WWW::Mechanize seems to use/be based on LWP::UserAgent, so these settings should do the trick.

"You have reached the Monastery. All our helpdesk monks are busy at the moment. Please press "1" to instantly donate 10 currency units for a good cause or press "2" to hang up. Or you can dial "12" to get connected directly to second level support."

In reply to Re: Can't get WWW::Mechanize get to work?? by cavac
in thread Can't get WWW::Mechanize get to work?? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.