Answer the question
In order to leave comments, you need to log in
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
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
You can get the entire page in its current form (already all loaded and processed) using the command document.documentElement.innerHTML
and then do whatever you need with it.
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 questionAsk a Question
731 491 924 answers to any question