Try this simplistic sequence... $content=~ s/\n/RETURN/g; $content=~ s/<.*?>//g; $content=~ s/RETURN/\n/g; print $content;
Agustin Rivera Webmaster, Pollstar.com http://www.pollstar.com ----- Original Message ----- From: "Daniel Falkenberg" <[EMAIL PROTECTED]> To: "Agustin Rivera" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, February 25, 2002 4:50 PM Subject: RE: Writing file to Windows > Agustin, > > Does the following code actually contain all the html code in $address? > > Is there a way I could strip all the html from $content? > > $address = "URL"; > my $content = LWP::Simple::get($address); > > Regards, > > Dan > > ============================== > VINTEK CONSULTING PTY LTD > (ACN 088 825 209) > email: [EMAIL PROTECTED] > web: <http://www.vintek.net> > Tel: (08) 8523 5035 > Fax: (08) 8523 2104 > Snail: P.O. Box 312 > Gawler SA 5118 > ============================== > > -----Original Message----- > From: Agustin Rivera [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, 26 February 2002 11:10 AM > To: Daniel Falkenberg > Subject: Re: Writing file to Windows > > > Then I'm sure it is a permissions problem. > > Agustin Rivera > Webmaster, Pollstar.com > http://www.pollstar.com > > > > ----- Original Message ----- > From: "Daniel Falkenberg" <[EMAIL PROTECTED]> > To: "Agustin Rivera" <[EMAIL PROTECTED]> > Sent: Monday, February 25, 2002 4:25 PM > Subject: RE: Writing file to Windows > > > > Hi again, > > > > Yes I am able to download the page I want from a command prompt > (running > > as administrator) but I can't do it from my web page. I'm sure it has > > to do with permissions or something like that? > > > > Regards, > > > > Dan > > > > -----Original Message----- > > From: Agustin Rivera [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, 26 February 2002 10:35 AM > > To: Daniel Falkenberg > > Subject: Re: Writing file to Windows > > > > > > Yes, it saved it to the file "temp". What site are you trying to > > download? > > I noticed on some sites, like a predefined search on Google.com, it > will > > return nothing. I suppose that is to prevent the others from stealing > > search results. > > > > Agustin Rivera > > Webmaster, Pollstar.com > > http://www.pollstar.com > > > > > > > > ----- Original Message ----- > > From: "Daniel Falkenberg" <[EMAIL PROTECTED]> > > To: "Agustin Rivera" <[EMAIL PROTECTED]> > > Sent: Monday, February 25, 2002 3:33 PM > > Subject: RE: Writing file to Windows > > > > > > > Really! Were you able to save the url to a file at a directorty > > > somewhere? > > > > > > Regards, > > > > > > Dan > > > > > > -----Original Message----- > > > From: Agustin Rivera [mailto:[EMAIL PROTECTED]] > > > Sent: Tuesday, 26 February 2002 10:01 AM > > > To: Daniel Falkenberg > > > Cc: [EMAIL PROTECTED] > > > Subject: Re: Writing file to Windows > > > > > > > > > I'm not sure that's it, because this code just ran fine on my > Windows > > > 2000 > > > box... > > > > > > use LWP::Simple; > > > use strict; > > > my $address="http://www.pollstar.com"; > > > my $html_file='temp'; > > > LWP::Simple::is_success(LWP::Simple::getstore($address, > $html_file)); > > > > > > > > > Agustin Rivera > > > Webmaster, Pollstar.com > > > http://www.pollstar.com > > > > > > > > > > > > ----- Original Message ----- > > > From: "Daniel Falkenberg" <[EMAIL PROTECTED]> > > > To: "Agustin Rivera" <[EMAIL PROTECTED]> > > > Cc: <[EMAIL PROTECTED]> > > > Sent: Monday, February 25, 2002 3:27 PM > > > Subject: RE: Writing file to Windows > > > > > > > > > > Aqustin, > > > > > > > > Yes that code works perfectly. The problem (I think) I am having > is > > > at > > > > this line here... > > > > > > > > LWP::Simple::is_success(LWP::Simple::getstore($address, > $html_file). > > > > > > > > It just doesn't seem to be storing it as a file? Any other ideas? > > > > > > > > Thx, > > > > > > > > Dan > > > > > > > > > > > > > > > > -----Original Message----- > > > > From: Agustin Rivera [mailto:[EMAIL PROTECTED]] > > > > Sent: Tuesday, 26 February 2002 9:54 AM > > > > To: Daniel Falkenberg; [EMAIL PROTECTED] > > > > Subject: Re: Writing file to Windows > > > > > > > > > > > > I'm getting a ton of errors just trying to get your code to work. > > But > > > > since > > > > you are addressing the simple grabbing of a web page, does this > code > > > > work... > > > > > > > > use LWP::Simple; > > > > use strict; > > > > > > > > my $address="http://www.pollstar.com"; > > > > my $content = get($address); > > > > print $content; > > > > > > > > > > > > Agustin Rivera > > > > Webmaster, Pollstar.com > > > > http://www.pollstar.com > > > > > > > > > > > > > > > > ----- Original Message ----- > > > > From: "Daniel Falkenberg" <[EMAIL PROTECTED]> > > > > To: <[EMAIL PROTECTED]> > > > > Sent: Monday, February 25, 2002 2:56 PM > > > > Subject: Writing file to Windows > > > > > > > > > > > > > Hey All, > > > > > > > > > > Is there any reason why I can't seem to get... > > > > > > > > > > LWP::Simple::is_success(LWP::Simple::getstore($address, > > $html_file) > > > > > > > > > > to write to a file. I have used the exact same code on a Linux > > box > > > > but > > > > > when I go to run it on a Windows box it doesn't seem to download > > it > > > > and > > > > > save it to a dir? Is this a permission problem? Is there > > something > > > I > > > > am > > > > > missing here? > > > > > > > > > > my $content = LWP::Simple::get($address); > > > > > $html_file = "foo.html"; > > > > > > > > > > if (LWP::Simple::mirror($address, $html_file) == > RC_NOT_MODIFIED) > > {} > > > > > if (LWP::Simple::is_success(LWP::Simple::getstore($address, > > > > > $html_file))) { > > > > > $p = HTML::TokeParser->new(shift||$html_file); > > > > > if ($p->get_tag("h1")) { > > > > > my $html_data= $p->get_trimmed_text; > > > > > print $html_data; > > > > > } > > > > > > > > > > Regards, > > > > > > > > > > Dan > > > > > > > > > > -- > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]