Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Read web page Data

by thinker (Parson)
on Jul 20, 2003 at 08:26 UTC ( [id://276009]=note: print w/replies, xml ) Need Help??


in reply to Read web page Data

Hi AM,

When you ask for yahoo.com, what you will get is the default page for that site, maybe index.html, or index.cgi, or whatever. It doesn't really matter what it is called, it is just an html page.

In which case, simply change $file = "/path/to/savefile.txt" to $file = "/path/to/savefile.html"

Of course, hardcoding the filename in there is of limited use, unless you want to rename the file after each run of the program

I hope this is what you were asking :-)

cheers

thinker

Replies are listed 'Best First'.
Re^2: Read web page Data
by Anonymous Monk on Jun 12, 2013 at 06:50 UTC
    Hi Monks, I also used code given here and I used following code as well but I did not get response: use strict; use warnings; use LWP::Simple; my $url = "http://www.google.com"; getprint($url); Windows7/perl 5.16.3 Can anyone please help me out here to extract data from any webpage. Thanks.
Re: Re: Read web page Data
by Anonymous Monk on Jul 20, 2003 at 12:05 UTC
    This is wht I want to ask : I want to code a perl script as follows . Open Netscape and type a url . This url can be anything like perlmonks.com or yahoo.com or any url . Now I want my perl script to read data for this url . Suppose I type the url like yahoo.com then the perl script must be able to read data of that page . But if I change the url to rediff.com or any other then it should read that particular web page data. That means as I keep changing the url in Netscape the perl script should continue to read data for that url page and save it somewhere . Normally to retrieve web page data I use : $url = "http://www.myurl.com/ But my problem comes when I change the url in Netscape I am unable to change the url for the $url. Can u suggest me how can I achieve it .
      Look at a combination solution of autoit and perl. autoit can read your freshly type url and call your perl script with that url. It might be a bit complicated but will certainly work out if you put in the effort.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://276009]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-18 02:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found