Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 246
  • Last Modified:

How to catch information from web page using perl

Hi ,maybe I am asking a stupid question but

what I want to do is ,
I am having link to some web page that print on the screen some information
can I read this information to some file ?
Is it possible ?

Please explain ,how can I do this .
Thanks
Vlad
0
Vlad77
Asked:
Vlad77
1 Solution
 
kanduraCommented:
Here's some command lines you can use:

    wget http://your/link/here
    # file is stored in 'here'

    perl -MLWP::Simple -e 'getprint("http://your/link/here")' > your/file/here

    GET http://your/link/here > your/file/here
0
 
Vlad77Author Commented:
This is a server that require username and password ,

How can I insert user and pass in perl using this wget or get commands ?
0
 
jmcgOwnerCommented:
That will probably depend on how the username and password are authenticated to the website. One possibility is that it is using what's called BASIC authentication, in which case you can supply the username and password in the URL:

wget http://username:password@www.some.site.name.dom/path/to/page.html

For other kinds of authentication (and we may be able to help you decide what kind is in use) you would most likely need to write a somewhat more complicated LWP script.
0
 
Irina_dushaCommented:
$req = GET 'http://XXXXXX/cgi-bin/';

$req->authorization_basic('login', 'pass'); $response = $ua->request( $req );
0
 
jcoffinCommented:
None of these work on my server.  Am I missing perl addon modules? I have a link just like http://username:password@www.some.site.name.dom/path/to/page.html which works fine in a browser. I just want perl to read it.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now