Reputation: 95
I want to get the current captcha that is displayed on a website. An example of this would be http://top100arena.com/in.asp?id=58978
How would I get the image link of the captcha that is displayed other than right clicking - > open image in new page?
Upvotes: 2
Views: 4317
Reputation: 1
Try using Firebug in firefox https://addons.mozilla.org/es/firefox/addon/firebug/, Its easy to use and in the Red section you´ll find a label named Image, you´ll find the image there.
Upvotes: 0
Reputation: 68847
You are looking for the div identified by "rechapta_image"
:
Then extract the src
attribute of the img element inside this div.
To do this, you can choose for an easy String-operation-based way or use a HTML parsing library like JSoup.
Here is an example of such an extract URL:
Actually, it seems that the chapta box is an iframe. So search for an iframe with src string containing "chapta". Example of such a iframe:
<iframe src="http://www.google.com/recaptcha/api/noscriptk=6LeyFroSAAAAAJTmR7CLZ5an7pcsS5eJ3wEoWHhJ"
height="300" width="500" frameborder="0"></iframe><br/>
So, once you extracted that URL, use JSoup again to find the URL to the image. The page fetched has a part this:
So, look for a center element, and get the img element out of it.
Upvotes: 1