A
A
artmirarmi2018-04-03 09:55:19
PHP
artmirarmi, 2018-04-03 09:55:19

Site parsing after js execution?

Hello, there is a site in which the page is initially loaded, and then data is loaded onto the page using js. If you look at the source code of the page, then there is no data there. It is clear that they are loaded dynamically and already on the client side.
Help solve this problem and parse the site
Here is a link to the site itself
https://edadeal.ru/magnitogorsk/offers

Answer the question

In order to leave comments, you need to log in

3 answer(s)
F
fomenko_alexandr, 2018-04-03
@fomenko_alexandr

A heavyweight library that executes js code and returns data with
phantomjs.org
JavaScript already selected. However, in your case this is not necessary. It is enough to track where requests are sent to receive data on the network tab, and parse this page already

A
Alexander, 2018-04-03
@satellite

You can get the entire page in its current form (already all loaded and processed) using the command document.documentElement.innerHTMLand then do whatever you need with it.

E
Evgen, 2018-04-03
@Verz1Lka

Here, for this request, the page receives data:
https://api.edadeal.ru/web/search/offers?count=30&...
However, the guys decided to deceive everyone and hide the data, so what the page returns must be run through the decoder base64.
If you are too lazy to bother with all these decoders and manually sending requests, you can use selenium + chrome headless, or splash from scrapinghub.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question