Answer the question
In order to leave comments, you need to log in
How to correctly configure the script to work through a proxy?
Hello! There was a problem about the proxy, is it enough what I'm doing. I change it in the chrome settings, like this:
settings->show advanced settings->change proxy server settings->configure local network settings,
then in the proxy server I fill in the address and port ip fields from hideme.ru/proxy-list
When This script on the open-server works fine, but the browser is not able to access any site. From other browsers too, that is, this is apparently a system setting.
is that enough? maybe it's better to change ip in the script itself in curl_setopt?
Tried to add
curl_setopt($ch, CURLOPT_PROXY, '41.242.90.3');
curl_setopt($ch, CURLOPT_PROXYPORT, '80');
$pageText =new Curl();
$ip_url = 'https://api.ipify.org/';
echo $pageip=$pageText->get_page($ip_url);
Answer the question
In order to leave comments, you need to log in
Good afternoon.
Proxies in curl you give correctly.
On the topic of free proxies from hideme.ru - I myself recently tried to parse through them and after the test I realized that out of the entire list, only 2 ip really worked and then not for long. So if you want to use a proxy, but it is desirable to use a verified list, and this is usually paid. And to be completely honest - even paid ones do not always work 100%, but in general they are definitely better than free ones.
I have been practicing prasing for a long time, and I can say the following:
If you use cheap proxies, then you cannot do without a proxy checker. How should the work of a proxy checker (Proxy checker for performance, if in Russian) be built?
We take a proxy, we access the url through it, which we parse, and if the page loaded quickly, and we received a certain page code that is in the footer, or a certain word that is located there, then we consider the proxy to be operational, and save it to a text file, then from this file we will take our proven proxies for use, BUT! As correctly noted above, free or cheap proxies die very quickly, and therefore there is a need to check the list of our proxies as often as possible. For example, once every 5-10 minutes, run all proxies with a script. In order not to spend a lot of time on checks, and when the main script is running, on slow proxies, we set the limits of the function. If the function works for a long time, then the proxy is a brake, and it makes no sense to waste time (more than 3-5 seconds) on it, we can move on to the next one.
Proxies, by the way, can be divided into 4 types:
Free - complete nonsense, which is not even worth spending time on.
Cheap ones - which are given in a large list, usually several thousand, and from them, with a good proxy checker, you can squeeze out a good result, but this is about parsing. If you have a bot that clicks on buttons, a lot of javascript, and other crap that cheap proxies can’t tolerate, it’s better to stop using them, in favor of individual proxies, which are not so expensive.
Individual proxies are given in one hand. They are not expensive. I buy here .
Such proxies, in turn, are also divided into ipv4, ipv6, etc., but which ones you need, check with support. They will tell you how these types of proxies differ.
Дорогие прокси - стоить могут по несколько сотен $, и мне вообще никогда не приходилось их использовать. Не знаю для чего они нужны. То ли их используют люди, которые не знают, что есть индивидуальные прокси подешевле, то ли для каких-то особых задач ими пользуются. Мне неведомо к сожалению.
Кстати если кому парсинг нужен будет - обращайтесь в телеграмм.
Надеюсь админ за ссылки сильно не рассердится.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question