Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > wget Question

Reply
Thread Tools

wget Question

 
 
Reinhard Glauber
Guest
Posts: n/a
 
      01-17-2006
$answer = system("wget http://www.bla.de/bla/blaDetail.aspx?ID=$i");

How can i push the content of a single html site into $answer ?

This line doesn't work


Thanks
 
Reply With Quote
 
 
 
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      01-17-2006
Reinhard Glauber wrote:
> $answer = system("wget http://www.bla.de/bla/blaDetail.aspx?ID=$i");
>
> How can i push the content of a single html site into $answer ?
>
> This line doesn't work


What did you do to find out before posting here? Did you possibly read
the docs for the functioh you are using?

perldoc -f system

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
 
Reply With Quote
 
 
 
 
Reinhard Glauber
Guest
Posts: n/a
 
      01-17-2006

"Gunnar Hjalmarsson" <(E-Mail Removed)> schrieb im Newsbeitrag news:(E-Mail Removed)...

> Reinhard Glauber wrote:


> What did you do to find out before posting here? Did you possibly read
> the docs for the functioh you are using?
>
> perldoc -f system



Not installed on my system .. I'm lucky .. no one can blame me )
You need to install the perl-doc package to use this program.


 
Reply With Quote
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      01-17-2006
Reinhard Glauber wrote:
> Gunnar Hjalmarsson schrieb:
>>What did you do to find out before posting here? Did you possibly read
>>the docs for the functioh you are using?
>>
>> perldoc -f system

>
> Not installed on my system .. I'm lucky .. no one can blame me )
> You need to install the perl-doc package to use this program.


No, you are not lucky, and anybody can blame you for not reading the
docs of the programming language you are using.

A few options:

- Install perldoc

- Install Perl on your PC. Since you seem to be on a Windows box, I'd
recommend the bundle at http://www.indigostar.com/indigoperl.htm, which
would give you the docs conveniently available as HTML documents.
http://www.activestate.com/ offers a similar bundle.

- Download the docs from http://www.activestate.com/

- Browse the docs on the web; in this case:
http://perldoc.perl.org/functions/system.html

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
 
Reply With Quote
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      01-17-2006
Gunnar Hjalmarsson wrote:
> - Download the docs from http://www.activestate.com/


Typo: I meant http://perldoc.perl.org/

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
 
Reply With Quote
 
Reinhard Glauber
Guest
Posts: n/a
 
      01-17-2006

"Gunnar Hjalmarsson" <(E-Mail Removed)> schrieb im Newsbeitrag news:(E-Mail Removed)...

> Gunnar Hjalmarsson wrote:

> > - Download the docs from http://www.activestate.com/

>
> Typo: I meant http://perldoc.perl.org/



aaaah, very nice
thanks
 
Reply With Quote
 
Jürgen Exner
Guest
Posts: n/a
 
      01-17-2006
Reinhard Glauber wrote:
> "Gunnar Hjalmarsson" <(E-Mail Removed)> schrieb im Newsbeitrag
> news:(E-Mail Removed)...
>> Reinhard Glauber wrote:

>
>> What did you do to find out before posting here? Did you possibly
>> read the docs for the functioh you are using?
>>
>> perldoc -f system

>
>
> Not installed on my system .. I'm lucky .. no one can blame me )
> You need to install the perl-doc package to use this program.


Well, then why don't you fix your broken Perl installation? Then you can
read the documentation yourself and don't have to ask someone else to read
them for you.

Oh, and to answer your original question: See perldoc -f system, third
paragraph, fourth sentence.
Not to mention that this Question is Asked very Frequently, too.

jue


 
Reply With Quote
 
A. Sinan Unur
Guest
Posts: n/a
 
      01-17-2006
"Reinhard Glauber" <(E-Mail Removed)> wrote in news:43ccbf22$0$21021$9b4e6d93
@newsread2.arcor-online.net:

> $answer = system("wget http://www.bla.de/bla/blaDetail.aspx?ID=$i");
>
> How can i push the content of a single html site into $answer ?
>
> This line doesn't work


Have you read the posting guidelines for this group?

In addition to Gunnar and Jurgen's comments, I suggest you take a look at

<URL:http://search.cpan.org/~gaas/libwww-perl-5.805/lib/LWP/Simple.pm>

Sinan
--
A. Sinan Unur <(E-Mail Removed)>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/cl...uidelines.html

 
Reply With Quote
 
Tad McClellan
Guest
Posts: n/a
 
      01-18-2006
Reinhard Glauber <(E-Mail Removed)> wrote:

> $answer = system("wget http://www.bla.de/bla/blaDetail.aspx?ID=$i");


perldoc -q HTML

How do I fetch an HTML file?

How do I automate an HTML form submission?


> How can i push the content of a single html site into $answer ?



The way it says to in the documentation for the function that
you are using, or the way that it says to in the Perl FAQ.


--
Tad McClellan SGML consulting
http://www.velocityreviews.com/forums/(E-Mail Removed) Perl programming
Fort Worth, Texas
 
Reply With Quote
 
usenet@DavidFilmer.com
Guest
Posts: n/a
 
      01-18-2006
Reinhard Glauber wrote:
> $answer = system("wget http://www.bla.de/bla/blaDetail.aspx?ID=$i");


That's not Perl - that's a shell command with a little bit of Perl
wrapped around it (and it's not even the right sort of Perl).

Real Perl programmers use real Perl functions and modules, and they
resort to shell commands only when absolutely necessary (which is
generally rare - I haven't used a raw shell command from Perl in three
years). The most common module for this purpose is LWP. But I always
recommend the use of the super-duper-module IO::All
(http://tinyurl.com/982wo), especially to novice programmers, because
it provides a nice, EASY proxy to LWP (and a bunch of other functions
and modules). How easy, you ask? Well, I'm REALLY GLAD you asked:

#!/usr/bin/perl
use warnings; use strict;
use IO::All;
my $content < io('http://example.org');
print $content;
__END__

IT DON'T GET NO MORE EASIER THAN THAT RIGHT THERE!

--
http://DavidFilmer.com

 
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
wget question Miguel NZ Computing 12 03-26-2007 09:55 PM
wget , how do I download when links are to a php .. ? jameshanley39@yahoo.co.uk Computer Information 0 01-04-2007 02:51 PM
Web get command (wget) to download all icons/pics on a web page (too large or too small) barb Digital Photography 5 08-04-2006 07:06 PM
looking for wget-like module for getching software Robert P. J. Day Python 2 12-16-2004 04:43 PM
WGET Henry Computer Security 1 08-11-2004 06:15 AM



Advertisments