Perl: the Markov chain saw | |
PerlMonks |
Crashing XML::LibXML by setting UserAgentby hacker (Priest) |
on May 27, 2003 at 13:00 UTC ( [id://260981]=perlquestion: print w/replies, xml ) | Need Help?? |
hacker has asked for the wisdom of the Perl Monks concerning the following question:
I just found that on very specific web pages parsed by my scripts, that setting a UserAgent value through LWP::UserAgent seems to crash XML::LibXML, and I can't figure out why. Here's a snippet to exhibit this behavior. Run this, then uncomment the $browser->agent($ua); call to see the crash:
It only happens on some pages, and I can't find a pattern in the actual HTML content itself that causes it. Here's the error I get when it dies (a few hundred of these for this particular page parsed):
Comment out the UserAgent value, and it seems to work perfectly, without any errors. What could be causing this? Update: Further investigation shows that the '/' in the UserAgent value is stuffing up XML::LibXML here. Changing the '/' to anything else will cause the page to work. Why would a slash character in the UserAgent string dump libxml?
Back to
Seekers of Perl Wisdom
|
|