Question

I want to parse webpage with Fragment identifier(#), f.e. http://steamcommunity.com/market/search?q=appid%3A570+uncommon#p4 When i use my browser(Google Chrome), i have different result, for different identifier(#p1,#p2,#p3), but when i use HTML Agility Pack, i always get first page, despite of page identifier.

string sURL = "http://steamcommunity.com/market/search?q=appid%3A570+uncommon#p"
wClient = new WebClient(); 
html = new HtmlAgilityPack.HtmlDocument();
html.LoadHtml(wClient.DownloadString(sURL+i));

I understand, that something like Ajax used here and in fact exist only one page. How can i fix my problem, and get results from other pages using C#?

Was it helpful?

Solution

Like David said,

use URL : http://steamcommunity.com/market/search/render/?query=appid%3A570%20uncommon&search_descriptions=0&start=30&count=10

where start is the start number and count is the number of items you want.

the result is a json result, so for stating the obvious you only want to use results_html

side note: in your chrome browser (when pressed F12) click on network tab and you will see the request and result being made

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top