Page Scraping of Authenticated pages with CredentialCache.DefaultCredentials

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

According to miscellaneous posts, this should work to the
effect of helping overcome FormsAuthentication when the
user is already logged in. In my case, the page that gets
scraped is the forms login page :?(.

Somehow the default credentials do not work on the new
WebRequest object.

Any amount of help will be appreciated,

Thanks,
Yuri

CookieContainerObject.Add(Cookie);
WebRequestObject.CookieContainer = CookieContainerObject;
WebRequestObject.Credentials =
CredentialCache.DefaultCredentials;

WebResponseObject = (HttpWebResponse)
WebRequestObject.GetResponse();
 
Forgot to mention that I did try

<identity impersonate="true"/> in the admin section of the
site

which did not work.

Thanks.
 
Back
Top