use strict; use warnings; use Win32::IE::Mechanize; my $ie = Win32::IE::Mechanize->new( visible => 1 ); use Data::Dumper; my $price = '249,9'; print "price: $price\n"; my $url = 'http://xml.pangora.com/scripts/Redirect.php?fid=45&mid=1066&serviceName=idealo-de&serviceType=portal&oid=1066de515358&sid=73&pt=idealo-de.export.1-0&url=http%3A%2F%2Fwww.baur.de%2Fis-bin%2FINTERSHOP.enfinity%2FWFS%2FBaur-BaurDe-Site%2Fde_DE%2F-%2FEUR%2FBV_ExternalCall-Start%3FArticleNo%3D515358%26NUMSArt%3D4443504%26NUMSArtPc%3D4488615%26AffiliateID%3Dpangora-%2A%26Name%3Dpangora-produktdaten-baur%26ActionID%3Dpreis-produkt-suche-baur%26WKZ%3D79%26IWL%3D101'; # if visible, you get an open IE window. my $mech = Win32::IE::Mechanize->new( visible => 1 ); #$mech->agent('Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.8.1) Gecko/20061010 (IKDhPmJcdw) Firefox/2.0'); $mech->get( $url ); my $html = $mech->content; unless ( $html =~ /$price/ ) { print "html from $url doesn't match $price\n"; print "even though IE mech opened a visible IE window, and the text there obviously DOES match.\n"; print "and what the heck is this blank IE window with no url in the location bar?\n"; print "you don't get that extra blank window if you call IE Mech against a more normal looking url, like http://www.yahoo.com.\n"; print "aaaaghh!\n"; # uncomment this to print html, which is totally different from what you get from firefox, show source. # print "html: $html"; } # # need something like # my $ieWindows = getwindows(); # should be two windows. # but ... module docu says "The internet Explorer automation object does not provide # an interface to poupp windows generated by security settings or jscript contained in the page". # So, I guess this won't work. Unless I can get into the IE object with OLE or something, # (which I know nothing about).