Click here to get back home

How Do You Get LWP To Deal With Javascript "Pop-Ups"

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
How Do You Get LWP To Deal With Javascript "Pop-Ups" mark1.thompson45 10-20-2005
Posted by mark1.thompson45 on October 20, 2005, 3:02 pm
Please log in for more thread options


Hi,
I am using LWP to navigate my way through the links on a webpage in
order to get to the data I need. I have got to the final page and it
seems that the data I need is in a "Javascript Popup". The page has the
following:-

<a href="javascript:popUp('PlayerList?gameid=184&catidx=1')"
class="nav">

It is the data in this pop-up that I need to get, forgive my lack of
knowledge here but LWP is new, whilst I have got this far I am now
completely stuck. If anyone can help it would be appreciated, a bit of
code would be even better - here's hoping.

cheers, Mark.



Posted by John Bokma on October 20, 2005, 10:30 pm
Please log in for more thread options


mark1.thompson45@btinternet.com wrote:

> Hi,
> I am using LWP to navigate my way through the links on a webpage in
> order to get to the data I need. I have got to the final page and it
> seems that the data I need is in a "Javascript Popup". The page has the
> following:-
>
> <a href="javascript:popUp('PlayerList?gameid=184&catidx=1')"
> class="nav">

The argument for popUp looks like a relative URL to me, so extract it, use
URI to create an absolute URL, and fetch it.

--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
I ploink googlegroups.com :-)



Posted by mark1.thompson45 on October 21, 2005, 4:16 pm
Please log in for more thread options


OK, so I need to create the URL from the javascript (I think ?) anyway,
this is the part of the code where I am trying to link to:-

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<script
type="text/javascript">document.write(imgmapHtml);document.close()</script><img
src="/new/ytm2006/html/images/MAIN_BANNER_2005_6.jpg" width="770"
height="72" border="0" ISMAP USEMAP="#imgareas"><table width="770"
border="0" cellspacing="0" cellpadding="0"><tr valign="top"><td
height="44" colspan="4" class="navbar"><table width="770" height="34"
border="0" cellpadding="0" cellspacing="0"><tr>
<td width="540" valign="top" class="nav"><img
src="/new/ytm2006/html/images/game.gif" width="69" height="33"
hspace="5" align="absmiddle"><a
href="javascript:popUp('/new/ytm2006/html/howtoplay.html')"
class="nav">How to play</a> | <a
href="javascript:popUp('/new/ytm2006/html/scoring.html')"
class="nav">Scoring points</a> | <a
href="javascript:popUp('/new/ytm2006/html/transfers.html')"
class="nav">Transfers</a> | <a
href="javascript:popUp('/new/ytm2006/html/leagues.html')"
class="nav">Mini leagues</a> | <a
href="javascript:popUp('/new/ytm2006/html/halloffame.html')"
class="nav">Hall of Fame</a> | <a
href="javascript:popUp('/new/ytm2006/html/prizes.html')"
class="nav">Prizes</a> | <a
href="javascript:popUp('/new/ytm2006/html/motm.html')"
class="nav">Monthly Game</a></td>
<td width="230" class="nav"><div align="left"><img
src="/new/ytm2006/html/images/stats.gif" width="90" height="33"
hspace="5" align="absmiddle"><a
href="javascript:popUp('PlayerList?gameid=184&catidx=1')"
class="nav">GK</a> | <a
href="javascript:popUp('PlayerList?gameid=184&catidx=2')"
class="nav">DEF</a> | <a
href="javascript:popUp('PlayerList?gameid=184&catidx=3')"
class="nav">MID</a> | <a
href="javascript:popUp('PlayerList?gameid=184&catidx=4')"
class="nav">STR</a> </div></td>
</tr>

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

I am after the Player Lists for GK, DEF, MID or STR from this
javascript. If I click on any of these links (GK, DEF, MID, STR) in an
IE browser I get the following pages:-

http://www.youthemanager.co.uk/Clever/servlet/PlayerList?gameid=184&catidx=1
(or catidx=2, catidx=3 etc)

I cannot workout what URL to call in my LWP::UserAgent or URI::URL call
(not sure whic to use), what ever I call the only text I get back from
the page is:-

<HTML><HEAD><SCRIPT
LANGUAGE="JAVASCRIPT">location.replace("/");</SCRIPT></HEAD></HTML>

help appreciated, thanks.



Similar ThreadsPosted
Javascript::MD5 V 1.04 July 29, 2004, 7:19 am
Javascript::MD5 V 1.05 November 21, 2005, 9:17 pm
Javascript::SHA1 V 1.01 July 29, 2004, 7:19 am
ANNOUNCE: Javascript::MD5 V 1.06 August 12, 2007, 12:15 am
Javascript::SHA1 V 1.03 August 12, 2007, 12:16 am
Access DOM using JavaScript::SpiderMonkey January 16, 2006, 12:37 pm
Quick Perl, HTML, CSS, JavaScript reference April 26, 2006, 10:34 am
Problems building Javascript-1.00 on Win32 system November 11, 2006, 9:59 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap