Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I'm enjoying Test::WWW::Mechanize with one quirk: It fails links to pages on wikipedia

A link to the main wikipedia page is ok.

There is no javascript in the page.

The link works in firefox, konqueror and wget. Per the WWW::Mechanize faq I've struggled to find the difference between the browsers and Mech

The only slight clue is that wget -vS shows that wikipedia is behind a squid caching proxy. --But this is also the case for the front page which works.

To get on w/ my life, I'm linking to gnu.org but still would appreciate any help in resolving this mystery.

Below is minimal but complete Perl / html to reproduce the problem

#!/usr/bin/perl use strict; use warnings; use Test::WWW::Mechanize; use Test::More tests=>2; my $mech=Test::WWW::Mechanize->new( "stack_depth" => 10, 'timeout' => +60 ); $mech->get_ok('http://localhost/test.html'); # fails $mech->page_links_ok(); __DATA__ <!-- http://localhost/test.html --> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title> test </title> </head> <body> <p> <a href="http://en.wikipedia.org/wiki/Affero_General_Public_Lice +nse"> fails </a> </p> <p> <a href="http://thecsl.org">works</a> </p> </p> <a href-="http://wikipedia.org/">works</a> </p> <p> <a href="http://en.wikipedia.org/wiki/Mode_Gakuen_Cocoon_Tower +">fails</a> </p> <p> <a href="http://www.gnu.org/licenses/agpl.html">?</a> </p> </body> </html>

In reply to Test::WWW::Mechanize page_links_ok fails on wikipedia entry external links by mandog

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-04-20 09:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found