Answer the question
In order to leave comments, you need to log in
Why does the Cloudflare stub drop out when parsing?
It was necessary to pull off the headers from the site, but instead of content, parsing on KURL gets Clara's stub
. Although when you open it with a browser, everything opens without it.
Curl code that should open the page
$url=$_GET['url'];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, '1');
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
curl_setopt($ch, CURLOPT_MAXREDIRS, 20);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$text = curl_exec($ch);
Answer the question
In order to leave comments, you need to log in
There is a python library - Cloudflare-scraper
https://github.com/Anorov/cloudflare-scrape
Works
great with Cloudflare protection.
Perhaps there is something similar in php ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question