in reply to Check for popups in webpage
Young Anonymous,
It's not about wanting and needing, but about sharing and contributing. So I'll help you out a little with this "working" script.
You'll have to change some things to get it working entirely with just perl instead of using system calls ;).
So it's up to you to:
- look up what strict does and to implement it.
- Look for what other javacode makes popups appear and implement the matching of it.
- See why the LWP-module is so very nifty, and usefull if you don't have lynx ;).
To speak with the unforgettable words of Janice Joplin, "Try-ha-ha-ha-ha, just a little bit harder".
#!/usr/bin/perl -w #popuppagechecker.pl $url = "empty";#;) if ($ARGV[0]) { $url = $ARGV[0]; } if ($url eq "empty"){ print "Specify url like popuppagechecker.pl http:\/\/www.makemyhomewor +k.com\n"; exit; } open TEL, "lynx -source $url|"; @text = <TEL>; $darnpopup = "false"; # teabags full report ;) print "@text\n$url"; foreach $line(@text){ if ($line =~ m/window.open/g){ print " probably has popups, (or some other lame javascript....)\n"; $darnpopup = "true"; } } if ($darnpopup ne "true"){ print " probably has no popups\n"; }
Hmm, I just realised fixing the above code sounds even like more homework then you're in for! hehe...
Teabag
Sure there's more than one way, but one just needs one anyway - Teabag
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Check for popups in webpage
by SyN/AcK (Scribe) on Jul 20, 2003 at 00:02 UTC | |
by jeffa (Bishop) on Jul 20, 2003 at 03:57 UTC | |
Re: Re: Check for popups in webpage
by Anonymous Monk on Jul 20, 2003 at 07:32 UTC | |
by bobn (Chaplain) on Jul 20, 2003 at 17:16 UTC |
In Section
Seekers of Perl Wisdom