I am trying parse Web Page. part of that page generated via AJAX,
WebClient.DownloadString I can get whole HTML except that code which is generated via AJAX? can you someone help me please?
My code is:
var client = new WebClient(); client .Headers.Add(HttpRequestHeader.UserAgent, "UserAgent,Mozilla/5.0 (Windows NT 5.1; rv:14.0) Gecko/20100101 Firefox/14.0.1"); client.Headers.Add(HttpRequestHeader.Cookie, "USER_PW=xxxxxxxxx; PHPSESSID=xxxxxxxxxxxxxxxxxx"); var html = client.DownloadString("xxxxxxxxxx");
I need list of vacancies...
its possible to get the content which is generated via AJAX But its not straight forward task, All you get is the page source (the same which you can see when you right click and say view page source)
To get the ajax content you must note down the url that the AJAX call hits and then make another call to this url to get the content.
Advantage: If all you are concerned with is only the data (like data from the website database) in the HTML and not the exact HTML itself, Then this approach will work for you.