I'm trying to use C#'s HttpWebRequest to get page source based on url.
In the browser, I'm doing this way:
- I go to http://brokercheck.finra.org/Search/Search.aspx
- Insert a zipcode, say 00501. and do a search.
I am then redirected to http://brokercheck.finra.org/Search/SearchResults.aspx?SearchGroup=Individual&IndlText=&FirmText=&ZipCode=00544&ZipRadius=5&PageNumber=1 This page's html is what I want.
The simple way of using a get method of HttpWebRequest doe not work. It will just get the html of search page.
I then tried to send a post and get cookies and send a get request with the cookies. But still, the response html was the search page's html.
GET. I would say you really need to analyze what's sent to the server (e.g. headers, body, request type).