O
O
Oleg2020-01-01 19:48:46
Python
Oleg, 2020-01-01 19:48:46

How to parse via requests/bs4, a site generated via JS?

Good afternoon.
I wanted to parse the site using requests/bs4. But the site is generated in JS, and the results of parsing through requests / bs4, does not give out :( (although Content-Type: text/html).
If I parse through selenium, then everything is OK, I get the necessary information.
Actually, the question is, can sites on js , parse through requests/bs4 and not through selenium?If so, how?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry Sviridov, 2020-01-01
@Oleg_F

No, you can't, because requests simply gets the content of the page (without executing js, of course), and bs4 parses the html. Selenium can only be replaced by PhantomJS.

I
Inviz Custos, 2020-01-01
@MvcBox

https://github.com/puppeteer/puppeteer

K
kkare, 2020-01-01
@kkare

Make a direct request to js, ​​often info will be returned in json, which is convenient for parsing

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question