Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Extracting html urls on a webpage using linktext

Reply
Thread Tools

Extracting html urls on a webpage using linktext

 
 
shankar_perl_rookie
Guest
Posts: n/a
 
      01-26-2011
Hello All,

I am using win32::IEAutomation to do some data extraction. I am
encountering a minor issue with extracting html urls on a page using
linktext. I generally use

$ie ->getLink('linktext:', $mytext) ->linkUrl();

The above line of code gives me the url corresponding $mytext. But my
problem now is there are multiple instances of the same $mytext on the
web page. Is there a way I can extract all the different urls
corresponding to the same linktext and store it in an array ?

Thanks,
Shankar
 
Reply With Quote
 
 
 
 
Jim
Guest
Posts: n/a
 
      01-27-2011
On Wed, 26 Jan 2011 12:24:29 -0800 (PST), shankar_perl_rookie
<(E-Mail Removed)> wrote:

>Hello All,
>
>I am using win32::IEAutomation to do some data extraction. I am
>encountering a minor issue with extracting html urls on a page using
>linktext. I generally use
>
>$ie ->getLink('linktext:', $mytext) ->linkUrl();
>
>The above line of code gives me the url corresponding $mytext. But my
>problem now is there are multiple instances of the same $mytext on the
>web page. Is there a way I can extract all the different urls
>corresponding to the same linktext and store it in an array ?


An array, as you have found, is not the proper data structure to store
this repeated information. You want to use a hash, or an associative
array (two different names for the same structure) -- this is the
third most useful structure in Perl, after scalars and simple arrays,
and one of the most powerful and useful structures in the language.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
JDBC URLs ...not really URLs? Adam Monsen Java 11 02-08-2009 08:14 PM
Converting Relative URLs into Absolute URLs Nathan Sokalski ASP .Net 1 08-12-2008 07:03 AM
Extracting text from a Webpage using BeautifulSoup Magnus.Moraberg@gmail.com Python 3 05-28-2008 12:26 AM
dynamic URLS convert to static URLS for search engines Steve T. ASP .Net Web Services 7 03-04-2004 03:16 PM
Distinguish text URLs from non-text URLs? Kaidi Java 5 01-04-2004 10:15 AM



Advertisments