开发者

C# HttpWebRequest and Javascript based form submittion actions

开发者 https://www.devze.com 2023-01-27 18:00 出处:网络
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 t

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 ha开发者_运维问答s 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消