Answer the question
In order to leave comments, you need to log in
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 #p2
ignored.
The source is taken like this:
string htmlCode;
using (WebClient client = new WebClient())
{
htmlCode = client.DownloadString("http://toster.ru/#p2");
}
Answer the question
In order to leave comments, you need to log in
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.
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.
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 questionAsk a Question
731 491 924 answers to any question