Perl LWP Proxy

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
## 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

LVL 13
Who is Participating?
Adam314Connect With a Mentor Commented:
Does that proxy work if you try to use it within a web browser?
$ua->proxy('http', $proxy_url);
marchentAuthor Commented:
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

it is not working.
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

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?
marchentAuthor Commented:
i'm getting
500 Can't connect to (connect: Unknown error)

or sometimes connection timed out

i just used the above ip and port as proxy. user password is not requires.
marchentAuthor Commented:
anyway, i need a valid proxy i guess.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.