0

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#?

Sam
  • 109
  • 1
  • 5
  • 2
    If it's really done via Ajax, you'd need to parse the first page and find any javascript that may execute a redirect, scrape that URL, and then do a 2nd webrequest... – Dmitriy Khaykin Feb 04 '14 at 03:03

1 Answers1

0

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

lordkain
  • 3,061
  • 1
  • 13
  • 18