K
K
Kurusa2020-01-22 21:54:53
PHP
Kurusa, 2020-01-22 21:54:53

Php, curl - how to pass a captcha that returns ERROR for site owner: Invalid domain for site key?

My task is to parse a site that only loads using vpn. This is how my request looks like:

curl_setopt($this->ch, CURLOPT_URL, $url);
    curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($this->ch, CURLINFO_HEADER_OUT, true);
    curl_setopt($this->ch, CURLOPT_HTTPHEADER, [
        "Upgrade-Insecure-Requests: 1",
        "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
        "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3",
        "Accept-Language: en-US,en;q=0.9"
    ]);

    return curl_exec($this->ch);

It is working, and I already wrote the parser, but sometimes it returns this:
5e289a729a99c667741730.png
How can I get around this?
The site I am dealing with is https://www.yad2.co.il

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nadim Zakirov, 2020-01-22
@zkrvndm

Parse data through the browser (in JavaScript), then there will be no such problems.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question