E
E
EshkinKat2013-12-28 15:38:47
C++ / C#
EshkinKat, 2013-12-28 15:38:47

Why are URL elements ignored?

There is a link of the form http://toster.ru/#p2, the page on which differs from the page on the link. http://toster.ru/
When receiving the source of the page for further processing, the source of the page is obtained http://toster.ru/, as if #p2ignored.
The source is taken like this:

string htmlCode;
using (WebClient client = new WebClient())
                {
                    htmlCode = client.DownloadString("http://toster.ru/#p2");
                }

How to avoid URL clipping?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Monnoroch, 2013-12-28
@EshkinKat

URL Hash is not taken into account by the server. Different content can only be due to js, ​​that is, after downloading, it is necessary to somehow emulate the user's actions that led to the hash change and execute the corresponding js.

V
Vitaly Arkhipov, 2013-12-28
@arvitaly

You need to use a different client, let's say the standard c# webbrowser element, and after loading it, get html from the document's DOM. It will work JS.

E
EshkinKat, 2013-12-28
@EshkinKat

And in a different way? I need to load a page every few seconds and parse it. It is somehow not kosher to dissipate computing resources for redrawing and page layout with JS, especially when I only need what is already there in the source code.
Or are you talking about the fact that there is AJAX loaded the contents of the forum? This is some kind of bydlokoding already. Although it may be so. Steam pages are heavy.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question