N
N
Nik2017-03-26 14:17:37
PHP
Nik, 2017-03-26 14:17:37

How to use proxy for Xpath + php parser?

Hello!
I wrote a php parser using Xpath and curl.
Everything was going well until I was banned by the right site, missing only one request. As a result, now I put the script on cron with every minute launch
. Please tell me how to use a proxy to get around this problem.
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lexey Felde, 2017-04-02
@Tekill

It is enough to look in the manual for all the parameters with the text PROXY .
For an HTTP proxy, this setting is enough:

curl_setopt($connection, CURLOPT_HTTPPROXYTUNNEL, false);
curl_setopt($connection, CURLOPT_PROXY, '66.96.200.39:80');
curl_setopt($connection, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question