Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery html2canvas无法捕获验证码图像_Jquery_Html_Screenshot_Capture_Html2canvas - Fatal编程技术网

Jquery html2canvas无法捕获验证码图像

Jquery html2canvas无法捕获验证码图像,jquery,html,screenshot,capture,html2canvas,Jquery,Html,Screenshot,Capture,Html2canvas,以下是html代码: <div id="divPage"> div_Page <br/> <img id="captchaimglogin" src="https://www.emirates.com/account/english/login/login.aspx?cptLogin_captcha=86e2a65e-f170-43b6-9c87-41787ff64a35&t=88d296b19e5e8000&mode=ssl" border="0"

以下是html代码:

<div id="divPage">
div_Page
<br/>
<img id="captchaimglogin" src="https://www.emirates.com/account/english/login/login.aspx?cptLogin_captcha=86e2a65e-f170-43b6-9c87-41787ff64a35&t=88d296b19e5e8000&mode=ssl" border="0" />
</div>
<br/>
<input type="button" id="btnSave" value="Save PNG"/>
$(function() {
    $("#btnSave").click(function() { 
        html2canvas($("#divPage"), {
            onrendered: function(canvas) {
                document.body.appendChild(canvas);
               }
         });
         html2canvas($("#btnSave"), {
            onrendered: function(canvas) {
                document.body.appendChild(canvas);
               }
         });
    });
}); 
这里是链接

如何使用html2canvas或其他方式捕获这些验证码图像

根据文档,您可以使用
allowTaint
taintTest
配置来允许跨原点图像

onrendered: function(canvas) {
            document.body.appendChild(canvas);
           },
allowTaint: true,
taintTest: false

在运行
html2canvas
之前,检测并删除原始页面上的
验证码


许多验证码的实现将有跨域内容,这将污染画布。污染画布将自动阻止html2canvas捕获页面…

“那么…为什么要费心捕获
验证码呢?”他怀疑地说。顺便说一句,许多验证码的实现将有跨域内容,这将污染画布,从而阻止捕获验证码;没有可疑活动,我只需要捕获整个页面,包括加载的验证码。很公平:-)我已经发布了一个关于如何捕获页面的答案,因为
captcha
可能会阻止html2canvas工作。
allowTaint
只是解决方案的一半。托管映像的服务器还必须配置为允许向匿名客户端提供映像服务。;-)但不直接对验证码图像起作用。有什么想法吗@我觉得这是关于马克的评论。文档还讨论了图像的局限性。听着,伙计,谢谢你的回答。我不小心否决了你,不能再提了。因此,其中一位成员再次投票支持这位成员,并感谢您的关注。