开发者

How to get the captcha when doing a webrequest?

开发者 https://www.devze.com 2023-03-27 05:07 出处:网络
I\'m letting my users register an email account, the users just fills in all information in my program and my program will fill the fields. Well not really it makes a POST request with the correct pos

I'm letting my users register an email account, the users just fills in all information in my program and my program will fill the fields. Well not really it makes a POST request with the correct postdata to the correct form/post url.

However the website requires a captcha, I just simply want to show the captcha to my user, he enters the value and then it gets send along with the postdata.

The register page is here: http://register.rediff.com/register/register.php?FormName=user_details

I can just get all image urls from the html but when I copy the url of the captcha image and go to it, it's a different image then开发者_运维问答 the image i copied the url from:

http://register.rediff.com/register/tb135/tb_getimage.php?uid=1312830635&start=JTNG

How do I do this using HttpWebRequest ? I can just grab the html first:

string html = new WebClient().DownloadString("http://register.rediff.com/register/register.php?FormName=user_details ");

Then get the image url but I don't know how to show the same captcha to the user?

Btw it's not for a bot... it's not something automated.. it's just I don't want the user to show the webinterface...


Not really answer, some advice instead:

If you're writing an app client to work with the website, a better approach would be to write a WCF/WebService for the App to interact with directly - this can just refer directly to your BL layer.

If you want the whole app to work on screen scraping then that's a lot of work ahead, and your app will be dependent on the site not being changed.

0

精彩评论

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

关注公众号