K
K
Kotaro Hiba2019-07-15 17:01:35
PHP
Kotaro Hiba, 2019-07-15 17:01:35

How to scrape an olx website?

Hello, I ran into one problem, I need to write a parser, when parsing it gives out null arrays
Link to the site
Here is an example code

$url = file_get_html('https://www.olx.ua/nedvizhimost/kharkov/?currency=USD');
 $findtest = $url->find('div.innerLayout');
echo $url;

Libraries that I tried to parse: simple dom html, phpQuery -> the result is the same
5d2c865f84704539539375.png
5d2c866e42d57436404001.png
.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
E
Evgen, 2019-07-15
@lina666

Obviously the site doesn't want to be scraped. You need to pretend to be a user, use good headers, User-Agent, ip etc...

S
Stalker_RED, 2019-07-15
@Stalker_RED

They feel it's a bot and give it a stub. You have to learn to be more human)

I
Ihor Bratukh, 2019-07-16
@BRAGA96

puppeteer

I
irishmann, 2019-07-16
@irishmann

CURL

A
astronotius, 2020-04-19
@astronotius

Puppeteer. But not simple, but with a set of antideterminants

  • useragent
  • languages
  • plugins
  • notifications
  • fingerprint
  • etc

Puppeteer example in headless mode: false

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question