Extracting html urls on a webpage using linktext

  • Thread starter shankar_perl_rookie
  • Start date
S

shankar_perl_rookie

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
 
J

Jim

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top