Is there a way that I can get the captcha image value using jquery/javascript and put it on the validation box?
Something I want to do on a form like below:
And the code for captcha is written like below:
<td><img id="form_rcdl:j_idt33:j_idt38" src="/rcdlstatus/DispplayCaptcha?txtp_cd=1&bkgp_cd=2&noise_cd=2&gimp_cd=3&txtp_length=5&pfdrid_c=true?1388469581&pfdrid_c=true" alt=""></td>
Is there a way that I can get the captcha image value using jquery/javascript and put it on the validation box?
Something I want to do on a form like below:
And the code for captcha is written like below:
<td><img id="form_rcdl:j_idt33:j_idt38" src="/rcdlstatus/DispplayCaptcha?txtp_cd=1&bkgp_cd=2&noise_cd=2&gimp_cd=3&txtp_length=5&pfdrid_c=true?1388469581&pfdrid_c=true" alt=""></td>
Share
Improve this question
asked Jul 13, 2018 at 12:09
choudhury smrutiranjan paridachoudhury smrutiranjan parida
2,7485 gold badges30 silver badges40 bronze badges
4
- 4 If you could do that, then why would captcha ever be used? – bassxzero Commented Jul 13, 2018 at 12:10
- There is no point in reading captcha at client side and validate it. What exactly you want to achieve here? – Bhushan Kawadkar Commented Jul 13, 2018 at 12:17
- Yes. That's true. But I am just curious if we can do that. – choudhury smrutiranjan parida Commented Jul 13, 2018 at 12:18
- I want to automate it in a simple page. – choudhury smrutiranjan parida Commented Jul 13, 2018 at 12:26
1 Answer
Reset to default 4Usually, these kinds of captcha are easy to pass/hack.
Now, this is can be done in different ways using other programming languages.
But as you are looking for a client side solution tesseract.js
might help.
I have not tried that before, but using it seems straightforward
Tesseract.recognize(myImage)
.progress(function (p) { console.log('progress', p) })
.then(function (result) { console.log('result', result) })
Here is a demo (On JSFiddle) you can try it (Won't work on StackOverflow )
you should get an alert says road
let progress = document.querySelector('#progress');
Tesseract.recognize('https://image.ibb.co/bXhgST/captcha_5.jpg')
.progress(function(p) {
progress.innerHTML += JSON.stringify(p) + "<br>"
})
.then(function(result) {
alert(result.text)
})
<script src='https://cdn.rawgit./naptha/tesseract.js/1.0.10/dist/tesseract.js'></script>
<img id="img" src="https://image.ibb.co/bXhgST/captcha_5.jpg" />
<div id="progress"></div>
Another option would be using a professional service like Amazon Detecting Text in an Image
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745474804a4629296.html
评论列表(0条)