C
C
Coder 14482021-02-03 22:28:42
Python
Coder 1448, 2021-02-03 22:28:42

How to parse a dynamic page with initially loaded js elements?

Website - https://focus.kontur.ru/ .
It initially loads many elements through js when loading the page. For example, the same search bar and the "search" button. Probably specifically against parsers.
requests is not found, neither is selenium.
The script that most likely loads everything - https://widget-product.kontur.ru/widget/loader?pro... .
How can it be parsed?

[SOLVED]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene TI, 2021-02-05
@wows15

I'm afraid the short answer is no.
This is to make the JS run by the native JS engine in the "native" browser environment.
Python html parsers do not support JS as a class (of course; this is not html parsing).
If you really need it, then try passing it through pdfkit (+ wkhtmltopdf) and parsing PDF as the output. It sounds like a mockery, but theoretically it is possible.
The second option is not to parse HTML, but instead of JS, ask AJAX questions to the server yourself.
But this is also only theoretical. If the server is done normally, then it will not allow this to be done.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question