简体   繁体   中英

How do I login to this website with C# to screen scrape it?

Greetings, I have scraped thousands of pages, but for the first time I need to setup a scrape for screens that are behind a login screen:

https://wmars.cwmars.org/patroninfo/

Anyone care to give me a lead on what I would need to do, in C#, to pass in the credentials for the above screen and the get to the screen 'behind' it?

Thanks in advance.

Generally speaking, once you log in one of two things will happen. Either they will send a cookie back that contains everything needed for the site to ensure the user is logged in or they will pass the information back on a query string.

Usually all you need to do is capture the cookie with your http request object and post that cookie back on subsequent calls to the site in question.

In this case it looks like the cookies to capture are named SESSION_SCOPE and III_SESSION_ID. There might be more. Just use firebug to look at the cookie list when logging in to the site to know what you need.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM