cormanaz has asked for the wisdom of the Perl Monks concerning the following question:
So I'm trying to do it with Win32::IE::Mechanize which can supposedly follow those links. When I point it at, for example, perlmonks.com, it works fine, but when I point it at one of the URLS from the Retuers feed it doesn't:
produces the htmluse strict; use Win32::IE::Mechanize; my $iemech = Win32::IE::Mechanize->new( visible => 1); $iemech->get('http://feeds.reuters.com/~r/reuters/topNews/~3/84952673/ +newsarticle.aspx'); my $html = $iemech->content; print $html;
which ain't anywhere close to the html for what's showing in the IE window.<HTML><HEAD><LINK href="http://i.today.reuters.com/media/styles/rcom-a +rticle.css" type=text/css rel=stylesheet><LINK href="http://i.today.r +euters.com/media/styles/rcom-master.css" type=text/css rel=stylesheet +> <SCRIPT language=javascript src="http://i.today.reuters.com/News/scrip +t/links.js" type=text/javascript></SCRIPT> </HEAD></HTML>
One thing I notice is that there is a redirect happening. But unlike WWW:Mechanize, Win32::IE::Mechanize seems not to store the content in its object but (I guess) gets it from the browser DOM. So it seems like the content method should return whatever is showing in the browser. But as you will see if you try the code, it doesn't.
Anyone know if there's a fix for this?
TIA...
Steve
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32::IE::Mechanize not getting correct content
by un-chomp (Scribe) on Mar 15, 2007 at 14:49 UTC | |
|
Re: Win32::IE::Mechanize not getting correct content
by scorpio17 (Canon) on Mar 15, 2007 at 21:02 UTC | |
by Joost (Canon) on Mar 16, 2007 at 16:16 UTC | |
|
Re: Win32::IE::Mechanize not getting correct content
by jhourcle (Prior) on Mar 15, 2007 at 16:37 UTC | |
by ikegami (Patriarch) on Mar 15, 2007 at 19:19 UTC | |
by cormanaz (Deacon) on Mar 15, 2007 at 19:01 UTC |