Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Perl LWP Proxy

Posted on 2007-12-03
6
4,136 Views
Last Modified: 2008-03-21
I'm using LWP::UserAgent to scrape data from a site. to hide my IP i used proxy that i found from web as they let ppl use as free. but it is not working. pls guide me what is the write way to do my task. i'm attaching my sample code.
my $ua = LWP::UserAgent->new;
$ua->proxy('http', $proxy_url); ## proxy_url contains somthing like http://10.10.10.10:1234/
$ua->timeout(10);
 
## now reading the webpage
my $request = HTTP::Request->new(GET => $web_url);
my $response = $ua->request($request);
my $content = $response->content();

Open in new window

0
Comment
Question by:marchent
  • 3
  • 3
6 Comments
 
LVL 39

Expert Comment

by:Adam314
ID: 20396407
$ua->proxy('http', $proxy_url);
0
 
LVL 13

Author Comment

by:marchent
ID: 20397034
adam, i didn't understand what u mean? i already used as u mean, pls check my code snippet.

$ua->proxy('http', $proxy_url); ## proxy_url contains somthing like http://10.10.10.10:1234/

it is not working.
0
 
LVL 39

Expert Comment

by:Adam314
ID: 20397173
What is not working?  What do you get?  Do you get an error message?
Does the proxy require a username/password?
Does it work if you use a web browser, and enter the $proxy_url as a proxy in the web browser?
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 13

Author Comment

by:marchent
ID: 20397293
i'm getting
500 Can't connect to 216.129.105.10:8080 (connect: Unknown error)

or sometimes connection timed out

i just used the above ip and port as proxy. user password is not requires.
0
 
LVL 39

Accepted Solution

by:
Adam314 earned 250 total points
ID: 20397419
Does that proxy work if you try to use it within a web browser?
0
 
LVL 13

Author Comment

by:marchent
ID: 20409979
anyway, i need a valid proxy i guess.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question