J
J
John Bjornsen2018-11-28 22:13:29
Parsing
John Bjornsen, 2018-11-28 22:13:29

Why is the list visible on the page but not in the source code?

I decided to parse the list of institutions and information about them from the site.
The site has such a list, the code of which is displayed in the developer panel:
5bfee6bbb9b79485083504.png
But when I open the entire source code of the page, the list elements are no longer there:
5bfee6c915073413575085.png
Actually, the problem is that my parser, receiving page, does not find list items on it. How is it that they are displayed in the developer toolbar, but not in the source code? And how do I get them out with a parser?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DevMan, 2018-11-29
@Bjornsen

the list is not ALREADY not there, but YET is not.
it is loaded by ajax request https://gorzdrav.spb.ru/api/clinic_list/after the page is loaded by the browser.
accordingly, a parser that does not know how to process js will see only an empty list.

D
Dmitry, 2018-11-28
@dimoff66

The source code is how the page came to the browser. Scripts can change it. The current state of the page in the developer console. If the parser cannot find something, then the request is not correct.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question