Reputation: 1
I have a pretty annoying problem with my new program...
I want programmatically search queries on google.
its working great but after a while google returns me their captcha page, but it isn't a regular response, it is a statuscode of 503 service unabailable and it goes directly to the catch {} with this exception and I cant get the html content that I get when I do the same thing in the browser...
I researched it on the internet and found nothing about a 503 response with html content...
I just wondered how can I get the page html source from the 503 response
thank you very much...
Upvotes: 0
Views: 1689
Reputation: 1658
Please check google TOS:
http://support.google.com/websearch/bin/answer.py?hl=en&answer=86640
This is the reason you are getting 503.
Here is a link which might help:
http://goohackle.com/break-google-captcha/
Upvotes: 0
Reputation: 168913
I'm assuming you're getting a WebException
. If so, you can access the HTTP response with something like...
try {
// Make the request...
} catch(WebException wexc) {
var httpResponse = (HttpWebResponse)wexc.Response;
if(httpResponse.StatusCode == HttpStatusCode.ServiceUnavailable) {
// You can read the response as usual here.
} else {
throw; // not something we care about, re-throw exception
}
}
Upvotes: 1
Reputation: 28134
Did you try to check there :
Error 503 C#
Try to use Fiddler2 to get more information for us ... you can get this error from various things ...
Upvotes: 0