简体   繁体   中英

C# HttpWebRequest and Javascript based form submittion actions

I am trying to make a simple web crawler as a learning experience and I have hit a wall. I am able to set cookies, get cookies, and keep cookies over a session however I am now stuck when attempting to submit login information. Looking at the source of the website I see that the login form has a username and password field with a submit button who's action is a javascript call.

If it was a POST call I wouldn't have a problem but I can't figure out how to handle logging in using HttpWebRequest. Is it possible? If not how can I go about doing this? (Can I?)

Just because it is a javascript call doesn't mean you can't do a POST. I would read the javascript and see what it does, then do something similar.

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