Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTTPS with Perl

Status
Not open for further replies.

king4lex

Programmer
Mar 31, 2005
2
US
Hi,

I'm pretty much a n00b with Perl. I'm writing a script that needs to be able to screen scrape pages off the Internet. I've figured out how to GET and POST using LWP::UserAgent's simple_request() function. But I also need to be able to access HTTPS pages, not just HTTP. I'm not sure how to go about that. Can anyone point me in the right direction?

Thx.
 
Never mind. I figured it out. Just use LWP::UserAgent's request() function instead of simple_request(). Example:

Code:
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
my $site = $ua->request( new HTTP::Request( 'GET', '[URL unfurl="true"]https://www.nodeworks.com'[/URL] ) );
# Print whatever is returned by [URL unfurl="true"]https://www.nodeworks.com[/URL]
print $blah->content;
 
You see what happens if you take some time to read the documentation?

Good job!

TIMTOWTDI
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top