I
I
IronGun2020-04-22 19:40:52
Python
IronGun, 2020-04-22 19:40:52

Site parsing after js loading?

There is a site that needs to be parsed ( https://catalog.onliner.by/mobile ). However, it loads the data via js. I'm using the requests python library, however it parses the page before requests (requests.get(url)). How to parse the page completely or make the parser stay on the page?

import requests

f = open ('ind.txt', 'w')
url ='https://catalog.onliner.by/mobile?mfr%5B0%5D=xiaomi'
r = requests.get(url)
f.write(r.text)
print(r.text)
f.close()

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Karbivnichy, 2020-04-22
@IronGun

Correct link:

https://catalog.onliner.by/sdapi/catalog.api/searc...
- he gives everything ready-made, in json.
Search other pages for xhr :
5ea080f7172c6024692671.png

T
Timur Pokrovsky, 2020-04-22
@Makaroshka007

https://python-scripts.com/question/7270

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question