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?
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.
尝试在firefox https://addons.mozilla.org/es/firefox/addon/firebug/中使用Firebug,它易于使用,在红色部分中,您将找到一个名为Image的标签,您将在其中找到该图像。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.