> Hi All,
> 
> I am a beginner at perl and would need some valued advice in 
> the following task. 

Then you'll love LWP::UserAgnet and LWP:Simple

> 1. I need to access a website like say, a pathway called 
> http://www.biocarta.com/pathfiles/h_il10Pathwa> y.asp

Not sure why you need to work with Win32::Ole exactly but...

#!/usr/bin/perl

use strict; 
#and 
use warnings; 
# they  will help you do better code and debug faster.

use LWP::Simple; # see search.cpan.org for more info
my $guts = get('http://www.biocarta.com/pathfiles/h_il10Pathway.asp');

> 2. Store 
> the navigable components found in the 
> imagemap component. There are some links here, which lead to 

This is a little more tricky since parsing html is not the funnest thign to do.

Look at search .cpan.org for HTML::Parser or somethgi like that.
Or if you can reasonably gaurantee the way the data will look you can use regexes to 
grab it from $guts;

my @links = $guts =~ /href=\"(.*)\"/mg; 

> display of a further search result for certain genes. I need 
> to extract and store the weblinks (to external websites) from 
> this gene search into a set of txt files. 

You can use open() (See perldoc -f open) to write to a file. 
But if it's a simpelk text file of reasonable size you might want to use File::Slurp;

use File::Slurp;
write_file('/home/linksfrommypage.txt', join "\n", @links);

> 
> For this, I have written the following code ... and then cant 
> go further. pls help.
> 
> *********
> use Win32::OLE;
> $browser = Win32::OLE->new('InternetExplorer.Application', 
> 'Quit'); $website ='http://www.biocarta.com/';  
> $webpage ='pathfiles/prolinePathway.asp';  
> $URL=$website.$webpage;
> $browser->Navigate($URL, 1,'_BLANK');   
> #part 1
> use LWP::Simple;
> $content=get($URL);
> 
> #part 2

> $content =~ tr/A-Z/a-z/; # lowercase everything
> $content =~ s/\"/'/g; # double quotes to single
> $content =~ s/\n//g; # get rid of the linefeeds
> $content =~ s/\s+//g; # compress spaces/tabs
> $content =~ /startpathwayimage(.*)endpathwayimage/;
> print $1;
> $content=$1;
> # store this output into a file 

So there is only one match at the url?

Take a look at open() (perldoc -f open)

> *********
> How to go further?? 
> 
> Thanks a ton in advance.
> K. 
> 
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to