Search code examples
c#htmlscreen-scrapingcaptcha

Serve up Captcha to user in Webbrowser in Windows Form


I'm writing an app to automate a search for flights on an airline webpage. Unfortunately, it uses a serious captcha. . . The automated process is not very involved, and doesn't run very quickly, but doing the search manually and writing down the prices is very laborious.

I would like to keep my automated code, but when the page is redirected to a Captcha (something that happens after every 10 requests or so), I want to serve the Captcha up in a Webform in a webbrowser, allow the user to read the Captcha, enter the text and hit 'Continue'. It's not much faster than doing the whole thing manually, but it is easier!

Unfortunately, I cannot get the Captcha image to render in a webbrowser. In fact, I can't even see it in Fiddler when I run through the web requests manually.

Any ideas about how I can display the Captcha in a Windows form? Once the user can see it, I can continue with creating the webrequests and postdata as usual.

Would appreciate any help at all.

Thanks.


Solution

  • I saw one like this on a county court site recently. The IMG was a GET request, but if requested it directly it wouldn't work. It turned out the request for the image needed a cookie. In my case I updated HTTPClient to accommodate it.