Skip to content
This repository has been archived by the owner on May 9, 2020. It is now read-only.

Adjusting code to parse & submit new captcha #292

Closed
wants to merge 3 commits into from

Conversation

drdokk
Copy link

@drdokk drdokk commented Dec 2, 2019

@TravisBuddy
Copy link

TravisBuddy commented Dec 2, 2019

Travis tests have failed

Hey @drdokk,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

Node.js: node

View build log

npm test
> cloudscraper@4.4.0 test /home/travis/build/codemanki/cloudscraper
> npm run lint && npm run test:typescript && nyc --reporter=html --reporter=text mocha


> cloudscraper@4.4.0 lint /home/travis/build/codemanki/cloudscraper
> eslint --ext .json --ext .js --ext .ts .


/home/travis/build/codemanki/cloudscraper/index.d.ts
  80:40  warning  Unexpected any. Specify a different type  @typescript-eslint/no-explicit-any

✖ 1 problem (0 errors, 1 warning)


> cloudscraper@4.4.0 test:typescript /home/travis/build/codemanki/cloudscraper
> tsc *.ts --noEmit && tsd



  Brotli (lib)
    ✓ should be available
    ✓ should have a decompress method
    ✓ decompress() should accept exactly 1 argument
    ✓ decompress() should accept buffer as input
    ✓ [internal] decompress() should produce the expected result
    - [external] decompress() should produce the expected result
    ✓ optional() should throw an error if the module contains an error

  Cloudscraper
    1) should handle onCaptcha promise being rejected with a falsy error
Unhandled rejection StatusCodeError: 403 - "<!DOCTYPE html>\n<!--[if lt IE 7]> <html class=\"no-js ie6 oldie\" lang=\"en-US\"> <![endif]-->\n<!--[if IE 7]>    <html class=\"no-js ie7 oldie\" lang=\"en-US\"> <![endif]-->\n<!--[if IE 8]>    <html class=\"no-js ie8 oldie\" lang=\"en-US\"> <![endif]-->\n<!--[if gt IE 8]><!--> <html class=\"no-js\" lang=\"en-US\"> <!--<![endif]-->\n<head>\n<title>Attention Required! | Cloudflare</title>\n<meta name=\"captcha-bypass\" id=\"captcha-bypass\" />\n<meta charset=\"UTF-8\" />\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=Edge,chrome=1\" />\n<meta name=\"robots\" content=\"noindex, nofollow\" />\n<meta name=\"viewport\" content=\"width=device-width,initial-scale=1,maximum-scale=1\" />\n<link rel=\"stylesheet\" id=\"cf_styles-css\" href=\"/cdn-cgi/styles/cf.errors.css\" type=\"text/css\" media=\"screen,projection\" />\n<!--[if lt IE 9]><link rel=\"stylesheet\" id='cf_styles-ie-css' href=\"/cdn-cgi/styles/cf.errors.ie.css\" type=\"text/css\" media=\"screen,projection\" /><![endif]-->\n<style type=\"text/css\">body{margin:0;padding:0}</style>\n\n\n<!--[if gte IE 10]><!--><script type=\"text/javascript\" src=\"/cdn-cgi/scripts/zepto.min.js\"></script><!--<![endif]-->\n<!--[if gte IE 10]><!--><script type=\"text/javascript\" src=\"/cdn-cgi/scripts/cf.common.js\"></script><!--<![endif]-->\n\n\n\n\n</head>\n<body>\n  <div id=\"cf-wrapper\">\n    <div class=\"cf-alert cf-alert-error cf-cookie-error\" id=\"cookie-alert\" data-translate=\"enable_cookies\">Please enable cookies.</div>\n    <div id=\"cf-error-details\" class=\"cf-error-details-wrapper\">\n      <div class=\"cf-wrapper cf-header cf-error-overview\">\n        <h1 data-translate=\"challenge_headline\">One more step</h1>\n        <h2 class=\"cf-subheadline\"><span data-translate=\"complete_sec_check\">Please complete the security check to access</span> example-site.dev</h2>\n      </div><!-- /.header -->\n\n      <div class=\"cf-section cf-highlight cf-captcha-container\">\n        <div class=\"cf-wrapper\">\n          <div class=\"cf-columns two\">\n            <div class=\"cf-column\">\n            <div style=\"position: absolute; top: -250px; left: -250px;\"><a href=\"https://macinline.com/answeradenoidal.php?day=688\">table</a></div>\n              <div class=\"cf-highlight-inverse cf-form-stacked\">\n                <form class=\"challenge-form\" id=\"challenge-form\" action=\"/cdn-cgi/l/chk_captcha\" method=\"get\">\n                  <input type=\"hidden\" name=\"s\" value=\"6b132d85d185a8255f2451d48fe6a8bee7154ea2-1555377580-1800-AQ1azEkeDOnQP5ByOpwUU/RdbKrmMwHYpkaenRvjPXtB0w8Vbjn/Ceg62tfpp/lT799kjDLEMMuDkEMqQ7iO51kniWCQm00BQvDGl+D0h/WvXDWO96YXOUD3qrqUTuzO7QbUOinc8y8kedvOQkr4c0o=\"></input>\n  <script type=\"text/javascript\" src=\"/cdn-cgi/scripts/cf.challenge.js\" data-type=\"normal\"  data-ray=\"0000000000000000\" async data-sitekey=\"6LfBixYUAAAAABhdHynFUIMA_sa4s-XsJvnjtgB0\"></script>\n  <div class=\"g-recaptcha\"></div>\n  <noscript id=\"cf-captcha-bookmark\" class=\"cf-captcha-info\">\n    <div><div style=\"width: 302px\">\n      <div>\n        <iframe src=\"https://www.google.com/recaptcha/api/fallback?k=6LfBixYUAAAAABhdHynFUIMA_sa4s-XsJvnjtgB0\" frameborder=\"0\" scrolling=\"no\" style=\"width: 302px; height:422px; border-style: none;\"></iframe>\n      </div>\n      <div style=\"width: 300px; border-style: none; bottom: 12px; left: 25px; margin: 0px; padding: 0px; right: 25px; background: #f9f9f9; border: 1px solid #c1c1c1; border-radius: 3px;\">\n        <textarea id=\"g-recaptcha-response\" name=\"g-recaptcha-response\" class=\"g-recaptcha-response\" style=\"width: 250px; height: 40px; border: 1px solid #c1c1c1; margin: 10px 25px; padding: 0px; resize: none;\"></textarea>\n        <input type=\"submit\" value=\"Submit\"></input>\n      </div>\n    </div></div>\n  </noscript>\n</form>\n\n                <script type=\"text/javascript\">\n  (function(){\n    var a = function() {try{return !!window.addEventListener} catch(e) {return !1} },\n    b = function(b, c) {a() ? document.addEventListener(\"DOMContentLoaded\", b, c) : document.attachEvent(\"onreadystatechange\", b)};\n    b(function(){\n      if (!a()) return;\n\n      window.addEventListener(\"message\", handleMessage, false)\n\n      function handleMessage(event) {\n        if (event.data && event.data.type === 'results') {\n          var f = document.getElementById('challenge-form');\n\n          if (f) {\n            addInput(f, 'bf_challenge_id', '342');\n            addInput(f, 'bf_execution_time', event.data.executionTimeMs);\n            addInput(f, 'bf_result_hash', event.data.resultHash);\n          }\n\n          window.removeEventListener(\"message\", handleMessage, false)\n        }\n      }\n\n      function addInput(parent, name, value) {\n        var input = document.createElement('input');\n        input.type = 'hidden';\n        input.name = name;\n        input.value = value;\n        parent.appendChild(input);\n      }\n\n      function withIframe(iframeContent) {\n        var iframe = document.createElement('iframe');\n        iframe.id = 'bf_test_iframe';\n        iframe.style.visibility = 'hidden';\n        document.body.appendChild(iframe);\n        var doc = (iframe.contentWindow || iframe.contentDocument).document;\n        doc.write(iframeContent);\n        doc.close();\n      }\n\n      withIframe(\"<!DOCTYPE HTML>\\n<meta charset=utf-8>\\n<html>\\n <head>\\n  <title><\\/title>\\n  <script src=\\\"https:\\/\\/ajax.cloudflare.com\\/cdn-cgi\\/scripts\\/697236fc\\/cloudflare-static\\/bot-filter.js\\\"><\\/__script__>\\n  \\n <\\/head>\\n <body>\\n    <h1><\\/h1>\\n  \\n <\\/body>\\n<\\/html>\\n<script>function r(){var r='<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?><root><child1>value1<\\/child1><\\/root>',e;return(new DOMParser).parseFromString(r,\\\"text\\/xml\\\")}test(function(){var r='<root xmlns=\\\"urn:bar\\\"><outer xmlns=\\\"\\\"><inner>value1<\\/inner><\\/outer><\\/root>',root=(new DOMParser).parseFromString(r,\\\"text\\/xml\\\").documentElement,e=(new XMLSerializer).serializeToString(root);__c$1(e)});<\\/__script__>\".replace(/\\/__script__/g, '/script'));\n\n    }, false);\n  })();\n  </script>\n\n              </div>\n            </div>\n\n            <div class=\"cf-column\">\n              <div class=\"cf-screenshot-container\">\n\n                <span class=\"cf-no-screenshot\"></span>\n\n              </div>\n            </div>\n          </div><!-- /.columns -->\n        </div>\n      </div><!-- /.captcha-container -->\n\n      <div class=\"cf-section cf-wrapper\">\n        <div class=\"cf-columns two\">\n          <div class=\"cf-column\">\n            <h2 data-translate=\"why_captcha_headline\">Why do I have to complete a CAPTCHA?</h2>\n\n            <p data-translate=\"why_captcha_detail\">Completing the CAPTCHA proves you are a human and gives you temporary access to the web property.</p>\n          </div>\n\n          <div class=\"cf-column\">\n            <h2 data-translate=\"resolve_captcha_headline\">What can I do to prevent this in the future?</h2>\n\n\n            <p data-translate=\"resolve_captcha_antivirus\">If you are on a personal connection, like at home, you can run an anti-virus scan on your device to make sure it is not infected with malware.</p>\n\n            <p data-translate=\"resolve_captcha_network\">If you are at an office or shared network, you can ask the network administrator to run a scan across the network looking for misconfigured or infected devices.</p>\n\n          </div>\n        </div>\n      </div><!-- /.section -->\n\n\n      <div class=\"cf-error-footer cf-wrapper\">\n  <p>\n    <span class=\"cf-footer-item\">Cloudflare Ray ID: <strong>0000000000000000</strong></span>\n    <span class=\"cf-footer-separator\">&bull;</span>\n    <span class=\"cf-footer-item\"><span>Your IP</span>: 000.00.000.00</span>\n    <span class=\"cf-footer-separator\">&bull;</span>\n    <span class=\"cf-footer-item\"><span>Performance &amp; security by</span> <a href=\"https://www.cloudflare.com/5xx-error-landing?utm_source=error_footer\" id=\"brand_link\" target=\"_blank\">Cloudflare</a></span>\n\n  </p>\n</div><!-- /.error-footer -->\n\n\n    </div><!-- /#cf-error-details -->\n  </div><!-- /#cf-wrapper -->\n\n  <script type=\"text/javascript\">\n  window._cf_translation = {};\n\n\n</script>\n\n</body>\n</html>\n"
    at new StatusCodeError (/home/travis/build/codemanki/cloudscraper/node_modules/request-promise-core/lib/errors.js:32:15)
    at Request.plumbing.callback (/home/travis/build/codemanki/cloudscraper/node_modules/request-promise-core/lib/plumbing.js:104:33)
    at Request.RP$callback [as _callback] (/home/travis/build/codemanki/cloudscraper/node_modules/request-promise-core/lib/plumbing.js:46:31)
    at self.callback (/home/travis/build/codemanki/cloudscraper/node_modules/request/request.js:185:22)
    at onRequestComplete (/home/travis/build/codemanki/cloudscraper/index.js:77:321)
    at onCloudflareResponse (/home/travis/build/codemanki/cloudscraper/index.js:43:23)
    at onRequestResponse (/home/travis/build/codemanki/cloudscraper/index.js:39:232)
    at Request.<anonymous> (/home/travis/build/codemanki/cloudscraper/index.js:29:376)
    at Object.onceWrapper (events.js:300:26)
    at Request.emit (events.js:210:5)
    at Request.<anonymous> (/home/travis/build/codemanki/cloudscraper/node_modules/request/request.js:1161:10)
    at Request.emit (events.js:210:5)
    at IncomingMessage.<anonymous> (/home/travis/build/codemanki/cloudscraper/node_modules/request/request.js:1083:12)
    at Object.onceWrapper (events.js:299:28)
    at IncomingMessage.emit (events.js:215:7)
    at endReadableNT (_stream_readable.js:1200:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)

    2) should resolve reCAPTCHA (version as on 10.04.2019) when user calls captcha.submit()
Unhandled rejection StatusCodeError: 403 - "<!DOCTYPE html>\n<!--[if lt IE 7]> <html class=\"no-js ie6 oldie\" lang=\"en-US\"> <![endif]-->\n<!--[if IE 7]>    <html class=\"no-js ie7 oldie\" lang=\"en-US\"> <![endif]-->\n<!--[if IE 8]>    <html class=\"no-js ie8 oldie\" lang=\"en-US\"> <![endif]-->\n<!--[if gt IE 8]><!--> <html class=\"no-js\" lang=\"en-US\"> <!--<![endif]-->\n<head>\n<title>Attention Required! | Cloudflare</title>\n<meta name=\"captcha-bypass\" id=\"captcha-bypass\" />\n<meta charset=\"UTF-8\" />\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=Edge,chrome=1\" />\n<meta name=\"robots\" content=\"noindex, nofollow\" />\n<meta name=\"viewport\" content=\"width=device-width,initial-scale=1,maximum-scale=1\" />\n<link rel=\"stylesheet\" id=\"cf_styles-css\" href=\"/cdn-cgi/styles/cf.errors.css\" type=\"text/css\" media=\"screen,projection\" />\n<!--[if lt IE 9]><link rel=\"stylesheet\" id='cf_styles-ie-css' href=\"/cdn-cgi/styles/cf.errors.ie.css\" type=\"text/css\" media=\"screen,projection\" /><![endif]-->\n<style type=\"text/css\">body{margin:0;padding:0}</style>\n\n\n<!--[if gte IE 10]><!--><script type=\"text/javascript\" src=\"/cdn-cgi/scripts/zepto.min.js\"></script><!--<![endif]-->\n<!--[if gte IE 10]><!--><script type=\"text/javascript\" src=\"/cdn-cgi/scripts/cf.common.js\"></script><!--<![endif]-->\n\n\n\n\n</head>\n<body>\n  <div id=\"cf-wrapper\">\n    <div class=\"cf-alert cf-alert-error cf-cookie-error\" id=\"cookie-alert\" data-translate=\"enable_cookies\">Please enable cookies.</div>\n    <div id=\"cf-error-details\" class=\"cf-error-details-wrapper\">\n      <div class=\"cf-wrapper cf-header cf-error-overview\">\n        <h1 data-translate=\"challenge_headline\">One more step</h1>\n        <h2 class=\"cf-subheadline\"><span data-translate=\"complete_sec_check\">Please complete the security check to access</span> example-site.dev</h2>\n      </div><!-- /.header -->\n\n      <div class=\"cf-section cf-highlight cf-captcha-container\">\n        <div class=\"cf-wrapper\">\n          <div class=\"cf-columns two\">\n            <div class=\"cf-column\">\n            <div style=\"position: absolute; top: -250px; left: -250px;\"><a href=\"https://macinline.com/answeradenoidal.php?day=688\">table</a></div>\n              <div class=\"cf-highlight-inverse cf-form-stacked\">\n                <form class=\"challenge-form\" id=\"challenge-form\" action=\"/cdn-cgi/l/chk_captcha\" method=\"get\">\n                  <input type=\"hidden\" name=\"s\" value=\"6b132d85d185a8255f2451d48fe6a8bee7154ea2-1555377580-1800-AQ1azEkeDOnQP5ByOpwUU/RdbKrmMwHYpkaenRvjPXtB0w8Vbjn/Ceg62tfpp/lT799kjDLEMMuDkEMqQ7iO51kniWCQm00BQvDGl+D0h/WvXDWO96YXOUD3qrqUTuzO7QbUOinc8y8kedvOQkr4c0o=\"></input>\n  <script type=\"text/javascript\" src=\"/cdn-cgi/scripts/cf.challenge.js\" data-type=\"normal\"  data-ray=\"0000000000000000\" async data-sitekey=\"6LfBixYUAAAAABhdHynFUIMA_sa4s-XsJvnjtgB0\"></script>\n  <div class=\"g-recaptcha\"></div>\n  <noscript id=\"cf-captcha-bookmark\" class=\"cf-captcha-info\">\n    <div><div style=\"width: 302px\">\n      <div>\n        <iframe src=\"https://www.google.com/recaptcha/api/fallback?k=6LfBixYUAAAAABhdHynFUIMA_sa4s-XsJvnjtgB0\" frameborder=\"0\" scrolling=\"no\" style=\"width: 302px; height:422px; border-style: none;\"></iframe>\n      </div>\n      <div style=\"width: 300px; border-style: none; bottom: 12px; left: 25px; margin: 0px; padding: 0px; right: 25px; background: #f9f9f9; border: 1px solid #c1c1c1; border-radius: 3px;\">\n        <textarea id=\"g-recaptcha-response\" name=\"g-recaptcha-response\" class=\"g-recaptcha-response\" style=\"width: 250px; height: 40px; border: 1px solid #c1c1c1; margin: 10px 25px; padding: 0px; resize: none;\"></textarea>\n        <input type=\"submit\" value=\"Submit\"></input>\n      </div>\n    </div></div>\n  </noscript>\n</form>\n\n                <script type=\"text/javascript\">\n  (function(){\n    var a = function() {try{return !!window.addEventListener} catch(e) {return !1} },\n    b = function(b, c) {a() ? document.addEventListener(\"DOMContentLoaded\", b, c) : document.attachEvent(\"onreadystatechange\", b)};\n    b(function(){\n      if (!a()) return;\n\n      window.addEventListener(\"message\", handleMessage, false)\n\n      function handleMessage(event) {\n        if (event.data && event.data.type === 'results') {\n          var f = document.getElementById('challenge-form');\n\n          if (f) {\n            addInput(f, 'bf_challenge_id', '342');\n            addInput(f, 'bf_execution_time', event.data.executionTimeMs);\n            addInput(f, 'bf_result_hash', event.data.resultHash);\n          }\n\n          window.removeEventListener(\"message\", handleMessage, false)\n        }\n      }\n\n      function addInput(parent, name, value) {\n        var input = document.createElement('input');\n        input.type = 'hidden';\n        input.name = name;\n        input.value = value;\n        parent.appendChild(input);\n      }\n\n      function withIframe(iframeContent) {\n        var iframe = document.createElement('iframe');\n        iframe.id = 'bf_test_iframe';\n        iframe.style.visibility = 'hidden';\n        document.body.appendChild(iframe);\n        var doc = (iframe.contentWindow || iframe.contentDocument).document;\n        doc.write(iframeContent);\n        doc.close();\n      }\n\n      withIframe(\"<!DOCTYPE HTML>\\n<meta charset=utf-8>\\n<html>\\n <head>\\n  <title><\\/title>\\n  <script src=\\\"https:\\/\\/ajax.cloudflare.com\\/cdn-cgi\\/scripts\\/697236fc\\/cloudflare-static\\/bot-filter.js\\\"><\\/__script__>\\n  \\n <\\/head>\\n <body>\\n    <h1><\\/h1>\\n  \\n <\\/body>\\n<\\/html>\\n<script>function r(){var r='<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?><root><child1>value1<\\/child1><\\/root>',e;return(new DOMParser).parseFromString(r,\\\"text\\/xml\\\")}test(function(){var r='<root xmlns=\\\"urn:bar\\\"><outer xmlns=\\\"\\\"><inner>value1<\\/inner><\\/outer><\\/root>',root=(new DOMParser).parseFromString(r,\\\"text\\/xml\\\").documentElement,e=(new XMLSerializer).serializeToString(root);__c$1(e)});<\\/__script__>\".replace(/\\/__script__/g, '/script'));\n\n    }, false);\n  })();\n  </script>\n\n              </div>\n            </div>\n\n            <div class=\"cf-column\">\n              <div class=\"cf-screenshot-container\">\n\n                <span class=\"cf-no-screenshot\"></span>\n\n              </div>\n            </div>\n          </div><!-- /.columns -->\n        </div>\n      </div><!-- /.captcha-container -->\n\n      <div class=\"cf-section cf-wrapper\">\n        <div class=\"cf-columns two\">\n          <div class=\"cf-column\">\n            <h2 data-translate=\"why_captcha_headline\">Why do I have to complete a CAPTCHA?</h2>\n\n            <p data-translate=\"why_captcha_detail\">Completing the CAPTCHA proves you are a human and gives you temporary access to the web property.</p>\n          </div>\n\n          <div class=\"cf-column\">\n            <h2 data-translate=\"resolve_captcha_headline\">What can I do to prevent this in the future?</h2>\n\n\n            <p data-translate=\"resolve_captcha_antivirus\">If you are on a personal connection, like at home, you can run an anti-virus scan on your device to make sure it is not infected with malware.</p>\n\n            <p data-translate=\"resolve_captcha_network\">If you are at an office or shared network, you can ask the network administrator to run a scan across the network looking for misconfigured or infected devices.</p>\n\n          </div>\n        </div>\n      </div><!-- /.section -->\n\n\n      <div class=\"cf-error-footer cf-wrapper\">\n  <p>\n    <span class=\"cf-footer-item\">Cloudflare Ray ID: <strong>0000000000000000</strong></span>\n    <span class=\"cf-footer-separator\">&bull;</span>\n    <span class=\"cf-footer-item\"><span>Your IP</span>: 000.00.000.00</span>\n    <span class=\"cf-footer-separator\">&bull;</span>\n    <span class=\"cf-footer-item\"><span>Performance &amp; security by</span> <a href=\"https://www.cloudflare.com/5xx-error-landing?utm_source=error_footer\" id=\"brand_link\" target=\"_blank\">Cloudflare</a></span>\n\n  </p>\n</div><!-- /.error-footer -->\n\n\n    </div><!-- /#cf-error-details -->\n  </div><!-- /#cf-wrapper -->\n\n  <script type=\"text/javascript\">\n  window._cf_translation = {};\n\n\n</script>\n\n</body>\n</html>\n"
    at new StatusCodeError (/home/travis/build/codemanki/cloudscraper/node_modules/request-promise-core/lib/errors.js:32:15)
    at Request.plumbing.callback (/home/travis/build/codemanki/cloudscraper/node_modules/request-promise-core/lib/plumbing.js:104:33)
    at Request.RP$callback [as _callback] (/home/travis/build/codemanki/cloudscraper/node_modules/request-promise-core/lib/plumbing.js:46:31)
    at self.callback (/home/travis/build/codemanki/cloudscraper/node_modules/request/request.js:185:22)
    at onRequestComplete (/home/travis/build/codemanki/cloudscraper/index.js:77:321)
    at onCloudflareResponse (/home/travis/build/codemanki/cloudscraper/index.js:43:23)
    at onRequestResponse (/home/travis/build/codemanki/cloudscraper/index.js:39:232)
    at Request.<anonymous> (/home/travis/build/codemanki/cloudscraper/index.js:29:376)
    at Object.onceWrapper (events.js:300:26)
    at Request.emit (events.js:210:5)
    at Request.<anonymous> (/home/travis/build/codemanki/cloudscraper/node_modules/request/request.js:1161:10)
    at Request.emit (events.js:210:5)
    at IncomingMessage.<anonymous> (/home/travis/build/codemanki/cloudscraper/node_modules/request/request.js:1083:12)
    at Object.onceWrapper (events.js:299:28)
    at IncomingMessage.emit (events.js:215:7)
    at endReadableNT (_stream_readable.js:1200:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)

    3) should callback with an error if user calls captcha.submit(error)
Unhandled rejection StatusCodeError: 403 - "<!DOCTYPE html>\n<!--[if lt IE 7]> <html class=\"no-js ie6 oldie\" lang=\"en-US\"> <![endif]-->\n<!--[if IE 7]>    <html class=\"no-js ie7 oldie\" lang=\"en-US\"> <![endif]-->\n<!--[if IE 8]>    <html class=\"no-js ie8 oldie\" lang=\"en-US\"> <![endif]-->\n<!--[if gt IE 8]><!--> <html class=\"no-js\" lang=\"en-US\"> <!--<![endif]-->\n<head>\n<title>Attention Required! | Cloudflare</title>\n<meta name=\"captcha-bypass\" id=\"captcha-bypass\" />\n<meta charset=\"UTF-8\" />\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=Edge,chrome=1\" />\n<meta name=\"robots\" content=\"noindex, nofollow\" />\n<meta name=\"viewport\" content=\"width=device-width,initial-scale=1,maximum-scale=1\" />\n<link rel=\"stylesheet\" id=\"cf_styles-css\" href=\"/cdn-cgi/styles/cf.errors.css\" type=\"text/css\" media=\"screen,projection\" />\n<!--[if lt IE 9]><link rel=\"stylesheet\" id='cf_styles-ie-css' href=\"/cdn-cgi/styles/cf.errors.ie.css\" type=\"text/css\" media=\"screen,projection\" /><![endif]-->\n<style type=\"text/css\">body{margin:0;padding:0}</style>\n\n\n<!--[if gte IE 10]><!--><script type=\"text/javascript\" src=\"/cdn-cgi/scripts/zepto.min.js\"></script><!--<![endif]-->\n<!--[if gte IE 10]><!--><script type=\"text/javascript\" src=\"/cdn-cgi/scripts/cf.common.js\"></script><!--<![endif]-->\n\n\n\n\n</head>\n<body>\n  <div id=\"cf-wrapper\">\n    <div class=\"cf-alert cf-alert-error cf-cookie-error\" id=\"cookie-alert\" data-translate=\"enable_cookies\">Please enable cookies.</div>\n    <div id=\"cf-error-details\" class=\"cf-error-details-wrapper\">\n      <div class=\"cf-wrapper cf-header cf-error-overview\">\n        <h1 data-translate=\"challenge_headline\">One more step</h1>\n        <h2 class=\"cf-subheadline\"><span data-translate=\"complete_sec_check\">Please complete the security check to access</span> example-site.dev</h2>\n      </div><!-- /.header -->\n\n      <div class=\"cf-section cf-highlight cf-captcha-container\">\n        <div class=\"cf-wrapper\">\n          <div class=\"cf-columns two\">\n            <div class=\"cf-column\">\n            <div style=\"position: absolute; top: -250px; left: -250px;\"><a href=\"https://macinline.com/answeradenoidal.php?day=688\">table</a></div>\n              <div class=\"cf-highlight-inverse cf-form-stacked\">\n                <form class=\"challenge-form\" id=\"challenge-form\" action=\"/cdn-cgi/l/chk_captcha\" method=\"get\">\n                  <input type=\"hidden\" name=\"s\" value=\"6b132d85d185a8255f2451d48fe6a8bee7154ea2-1555377580-1800-AQ1azEkeDOnQP5ByOpwUU/RdbKrmMwHYpkaenRvjPXtB0w8Vbjn/Ceg62tfpp/lT799kjDLEMMuDkEMqQ7iO51kniWCQm00BQvDGl+D0h/WvXDWO96YXOUD3qrqUTuzO7QbUOinc8y8kedvOQkr4c0o=\"></input>\n  <script type=\"text/javascript\" src=\"/cdn-cgi/scripts/cf.challenge.js\" data-type=\"normal\"  data-ray=\"0000000000000000\" async data-sitekey=\"6LfBixYUAAAAABhdHynFUIMA_sa4s-XsJvnjtgB0\"></script>\n  <div class=\"g-recaptcha\"></div>\n  <noscript id=\"cf-captcha-bookmark\" class=\"cf-captcha-info\">\n    <div><div style=\"width: 302px\">\n      <div>\n        <iframe src=\"https://www.google.com/recaptcha/api/fallback?k=6LfBixYUAAAAABhdHynFUIMA_sa4s-XsJvnjtgB0\" frameborder=\"0\" scrolling=\"no\" style=\"width: 302px; height:422px; border-style: none;\"></iframe>\n      </div>\n      <div style=\"width: 300px; border-style: none; bottom: 12px; left: 25px; margin: 0px; padding: 0px; right: 25px; background: #f9f9f9; border: 1px solid #c1c1c1; border-radius: 3px;\">\n        <textarea id=\"g-recaptcha-response\" name=\"g-recaptcha-response\" class=\"g-recaptcha-response\" style=\"width: 250px; height: 40px; border: 1px solid #c1c1c1; margin: 10px 25px; padding: 0px; resize: none;\"></textarea>\n        <input type=\"submit\" value=\"Submit\"></input>\n      </div>\n    </div></div>\n  </noscript>\n</form>\n\n                <script type=\"text/javascript\">\n  (function(){\n    var a = function() {try{return !!window.addEventListener} catch(e) {return !1} },\n    b = function(b, c) {a() ? document.addEventListener(\"DOMContentLoaded\", b, c) : document.attachEvent(\"onreadystatechange\", b)};\n    b(function(){\n      if (!a()) return;\n\n      window.addEventListener(\"message\", handleMessage, false)\n\n      function handleMessage(event) {\n        if (event.data && event.data.type === 'results') {\n          var f = document.getElementById('challenge-form');\n\n          if (f) {\n            addInput(f, 'bf_challenge_id', '342');\n            addInput(f, 'bf_execution_time', event.data.executionTimeMs);\n            addInput(f, 'bf_result_hash', event.data.resultHash);\n          }\n\n          window.removeEventListener(\"message\", handleMessage, false)\n        }\n      }\n\n      function addInput(parent, name, value) {\n        var input = document.createElement('input');\n        input.type = 'hidden';\n        input.name = name;\n        input.value = value;\n        parent.appendChild(input);\n      }\n\n      function withIframe(iframeContent) {\n        var iframe = document.createElement('iframe');\n        iframe.id = 'bf_test_iframe';\n        iframe.style.visibility = 'hidden';\n        document.body.appendChild(iframe);\n        var doc = (iframe.contentWindow || iframe.contentDocument).document;\n        doc.write(iframeContent);\n        doc.close();\n      }\n\n      withIframe(\"<!DOCTYPE HTML>\\n<meta charset=utf-8>\\n<html>\\n <head>\\n  <title><\\/title>\\n  <script src=\\\"https:\\/\\/ajax.cloudflare.com\\/cdn-cgi\\/scripts\\/697236fc\\/cloudflare-static\\/bot-filter.js\\\"><\\/__script__>\\n  \\n <\\/head>\\n <body>\\n    <h1><\\/h1>\\n  \\n <\\/body>\\n<\\/html>\\n<script>function r(){var r='<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?><root><child1>value1<\\/child1><\\/root>',e;return(new DOMParser).parseFromString(r,\\\"text\\/xml\\\")}test(function(){var r='<root xmlns=\\\"urn:bar\\\"><outer xmlns=\\\"\\\"><inner>value1<\\/inner><\\/outer><\\/root>',root=(new DOMParser).parseFromString(r,\\\"text\\/xml\\\").documentElement,e=(new XMLSerializer).serializeToString(root);__c$1(e)});<\\/__script__>\".replace(/\\/__script__/g, '/script'));\n\n    }, false);\n  })();\n  </script>\n\n              </div>\n            </div>\n\n            <div class=\"cf-column\">\n              <div class=\"cf-screenshot-container\">\n\n                <span class=\"cf-no-screenshot\"></span>\n\n              </div>\n            </div>\n          </div><!-- /.columns -->\n        </div>\n      </div><!-- /.captcha-container -->\n\n      <div class=\"cf-section cf-wrapper\">\n        <div class=\"cf-columns two\">\n          <div class=\"cf-column\">\n            <h2 data-translate=\"why_captcha_headline\">Why do I have to complete a CAPTCHA?</h2>\n\n            <p data-translate=\"why_captcha_detail\">Completing the CAPTCHA proves you are a human and gives you temporary access to the web property.</p>\n          </div>\n\n          <div class=\"cf-column\">\n            <h2 data-translate=\"resolve_captcha_headline\">What can I do to prevent this in the future?</h2>\n\n\n            <p data-translate=\"resolve_captcha_antivirus\">If you are on a personal connection, like at home, you can run an anti-virus scan on your device to make sure it is not infected with malware.</p>\n\n            <p data-translate=\"resolve_captcha_network\">If you are at an office or shared network, you can ask the network administrator to run a scan across the network looking for misconfigured or infected devices.</p>\n\n          </div>\n        </div>\n      </div><!-- /.section -->\n\n\n      <div class=\"cf-error-footer cf-wrapper\">\n  <p>\n    <span class=\"cf-footer-item\">Cloudflare Ray ID: <strong>0000000000000000</strong></span>\n    <span class=\"cf-footer-separator\">&bull;</span>\n    <span class=\"cf-footer-item\"><span>Your IP</span>: 000.00.000.00</span>\n    <span class=\"cf-footer-separator\">&bull;</span>\n    <span class=\"cf-footer-item\"><span>Performance &amp; security by</span> <a href=\"https://www.cloudflare.com/5xx-error-landing?utm_source=error_footer\" id=\"brand_link\" target=\"_blank\">Cloudflare</a></span>\n\n  </p>\n</div><!-- /.error-footer -->\n\n\n    </div><!-- /#cf-error-details -->\n  </div><!-- /#cf-wrapper -->\n\n  <script type=\"text/javascript\">\n  window._cf_translation = {};\n\n\n</script>\n\n</body>\n</html>\n"
    at new StatusCodeError (/home/travis/build/codemanki/cloudscraper/node_modules/request-promise-core/lib/errors.js:32:15)
    at Request.plumbing.callback (/home/travis/build/codemanki/cloudscraper/node_modules/request-promise-core/lib/plumbing.js:104:33)
    at Request.RP$callback [as _callback] (/home/travis/build/codemanki/cloudscraper/node_modules/request-promise-core/lib/plumbing.js:46:31)
    at self.callback (/home/travis/build/codemanki/cloudscraper/node_modules/request/request.js:185:22)
    at onRequestComplete (/home/travis/build/codemanki/cloudscraper/index.js:77:321)
    at onCloudflareResponse (/home/travis/build/codemanki/cloudscraper/index.js:43:23)
    at onRequestResponse (/home/travis/build/codemanki/cloudscraper/index.js:39:232)
    at Request.<anonymous> (/home/travis/build/codemanki/cloudscraper/index.js:29:376)
    at Object.onceWrapper (events.js:300:26)
    at Request.emit (events.js:210:5)
    at Request.<anonymous> (/home/travis/build/codemanki/cloudscraper/node_modules/request/request.js:1161:10)
    at Request.emit (events.js:210:5)
    at IncomingMessage.<anonymous> (/home/travis/build/codemanki/cloudscraper/node_modules/request/request.js:1083:12)
    at Object.onceWrapper (events.js:299:28)
    at IncomingMessage.emit (events.js:215:7)
    at endReadableNT (_stream_readable.js:1200:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)

    4) should resolve reCAPTCHA (version as on 10.04.2019) when the onCaptcha promise resolves
Unhandled rejection StatusCodeError: 403 - "<!DOCTYPE html>\n<!--[if lt IE 7]> <html class=\"no-js ie6 oldie\" lang=\"en-US\"> <![endif]-->\n<!--[if IE 7]>    <html class=\"no-js ie7 oldie\" lang=\"en-US\"> <![endif]-->\n<!--[if IE 8]>    <html class=\"no-js ie8 oldie\" lang=\"en-US\"> <![endif]-->\n<!--[if gt IE 8]><!--> <html class=\"no-js\" lang=\"en-US\"> <!--<![endif]-->\n<head>\n<title>Attention Required! | Cloudflare</title>\n<meta name=\"captcha-bypass\" id=\"captcha-bypass\" />\n<meta charset=\"UTF-8\" />\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=Edge,chrome=1\" />\n<meta name=\"robots\" content=\"noindex, nofollow\" />\n<meta name=\"viewport\" content=\"width=device-width,initial-scale=1,maximum-scale=1\" />\n<link rel=\"stylesheet\" id=\"cf_styles-css\" href=\"/cdn-cgi/styles/cf.errors.css\" type=\"text/css\" media=\"screen,projection\" />\n<!--[if lt IE 9]><link rel=\"stylesheet\" id='cf_styles-ie-css' href=\"/cdn-cgi/styles/cf.errors.ie.css\" type=\"text/css\" media=\"screen,projection\" /><![endif]-->\n<style type=\"text/css\">body{margin:0;padding:0}</style>\n\n\n<!--[if gte IE 10]><!--><script type=\"text/javascript\" src=\"/cdn-cgi/scripts/zepto.min.js\"></script><!--<![endif]-->\n<!--[if gte IE 10]><!--><script type=\"text/javascript\" src=\"/cdn-cgi/scripts/cf.common.js\"></script><!--<![endif]-->\n\n\n\n\n</head>\n<body>\n  <div id=\"cf-wrapper\">\n    <div class=\"cf-alert cf-alert-error cf-cookie-error\" id=\"cookie-alert\" data-translate=\"enable_cookies\">Please enable cookies.</div>\n    <div id=\"cf-error-details\" class=\"cf-error-details-wrapper\">\n      <div class=\"cf-wrapper cf-header cf-error-overview\">\n        <h1 data-translate=\"challenge_headline\">One more step</h1>\n        <h2 class=\"cf-subheadline\"><span data-translate=\"complete_sec_check\">Please complete the security check to access</span> example-site.dev</h2>\n      </div><!-- /.header -->\n\n      <div class=\"cf-section cf-highlight cf-captcha-container\">\n        <div class=\"cf-wrapper\">\n          <div class=\"cf-columns two\">\n            <div class=\"cf-column\">\n            <div style=\"position: absolute; top: -250px; left: -250px;\"><a href=\"https://macinline.com/answeradenoidal.php?day=688\">table</a></div>\n              <div class=\"cf-highlight-inverse cf-form-stacked\">\n                <form class=\"challenge-form\" id=\"challenge-form\" action=\"/cdn-cgi/l/chk_captcha\" method=\"get\">\n                  <input type=\"hidden\" name=\"s\" value=\"6b132d85d185a8255f2451d48fe6a8bee7154ea2-1555377580-1800-AQ1azEkeDOnQP5ByOpwUU/RdbKrmMwHYpkaenRvjPXtB0w8Vbjn/Ceg62tfpp/lT799kjDLEMMuDkEMqQ7iO51kniWCQm00BQvDGl+D0h/WvXDWO96YXOUD3qrqUTuzO7QbUOinc8y8kedvOQkr4c0o=\"></input>\n  <script type=\"text/javascript\" src=\"/cdn-cgi/scripts/cf.challenge.js\" data-type=\"normal\"  data-ray=\"0000000000000000\" async data-sitekey=\"6LfBixYUAAAAABhdHynFUIMA_sa4s-XsJvnjtgB0\"></script>\n  <div class=\"g-recaptcha\"></div>\n  <noscript id=\"cf-captcha-bookmark\" class=\"cf-captcha-info\">\n    <div><div style=\"width: 302px\">\n      <div>\n        <iframe src=\"https://www.google.com/recaptcha/api/fallback?k=6LfBixYUAAAAABhdHynFUIMA_sa4s-XsJvnjtgB0\" frameborder=\"0\" scrolling=\"no\" style=\"width: 302px; height:422px; border-style: none;\"></iframe>\n      </div>\n      <div style=\"width: 300px; border-style: none; bottom: 12px; left: 25px; margin: 0px; padding: 0px; right: 25px; background: #f9f9f9; border: 1px solid #c1c1c1; border-radius: 3px;\">\n        <textarea id=\"g-recaptcha-response\" name=\"g-recaptcha-response\" class=\"g-recaptcha-response\" style=\"width: 250px; height: 40px; border: 1px solid #c1c1c1; margin: 10px 25px; padding: 0px; resize: none;\"></textarea>\n        <input type=\"submit\" value=\"Submit\"></input>\n      </div>\n    </div></div>\n  </noscript>\n</form>\n\n                <script type=\"text/javascript\">\n  (function(){\n    var a = function() {try{return !!window.addEventListener} catch(e) {return !1} },\n    b = function(b, c) {a() ? document.addEventListener(\"DOMContentLoaded\", b, c) : document.attachEvent(\"onreadystatechange\", b)};\n    b(function(){\n      if (!a()) return;\n\n      window.addEventListener(\"message\", handleMessage, false)\n\n      function handleMessage(event) {\n        if (event.data && event.data.type === 'results') {\n          var f = document.getElementById('challenge-form');\n\n          if (f) {\n            addInput(f, 'bf_challenge_id', '342');\n            addInput(f, 'bf_execution_time', event.data.executionTimeMs);\n            addInput(f, 'bf_result_hash', event.data.resultHash);\n          }\n\n          window.removeEventListener(\"message\", handleMessage, false)\n        }\n      }\n\n      function addInput(parent, name, value) {\n        var input = document.createElement('input');\n        input.type = 'hidden';\n        input.name = name;\n        input.value = value;\n        parent.appendChild(input);\n      }\n\n      function withIframe(iframeContent) {\n        var iframe = document.createElement('iframe');\n        iframe.id = 'bf_test_iframe';\n        iframe.style.visibility = 'hidden';\n        document.body.appendChild(iframe);\n        var doc = (iframe.contentWindow || iframe.contentDocument).document;\n        doc.write(iframeContent);\n        doc.close();\n      }\n\n      withIframe(\"<!DOCTYPE HTML>\\n<meta charset=utf-8>\\n<html>\\n <head>\\n  <title><\\/title>\\n  <script src=\\\"https:\\/\\/ajax.cloudflare.com\\/cdn-cgi\\/scripts\\/697236fc\\/cloudflare-static\\/bot-filter.js\\\"><\\/__script__>\\n  \\n <\\/head>\\n <body>\\n    <h1><\\/h1>\\n  \\n <\\/body>\\n<\\/html>\\n<script>function r(){var r='<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?><root><child1>value1<\\/child1><\\/root>',e;return(new DOMParser).parseFromString(r,\\\"text\\/xml\\\")}test(function(){var r='<root xmlns=\\\"urn:bar\\\"><outer xmlns=\\\"\\\"><inner>value1<\\/inner><\\/outer><\\/root>',root=(new DOMParser).parseFromString(r,\\\"text\\/xml\\\").documentElement,e=(new XMLSerializer).serializeToString(root);__c$1(e)});<\\/__script__>\".replace(/\\/__script__/g, '/script'));\n\n    }, false);\n  })();\n  </script>\n\n              </div>\n            </div>\n\n            <div class=\"cf-column\">\n              <div class=\"cf-screenshot-container\">\n\n                <span class=\"cf-no-screenshot\"></span>\n\n              </div>\n            </div>\n          </div><!-- /.columns -->\n        </div>\n      </div><!-- /.captcha-container -->\n\n      <div class=\"cf-section cf-wrapper\">\n        <div class=\"cf-columns two\">\n          <div class=\"cf-column\">\n            <h2 data-translate=\"why_captcha_headline\">Why do I have to complete a CAPTCHA?</h2>\n\n            <p data-translate=\"why_captcha_detail\">Completing the CAPTCHA proves you are a human and gives you temporary access to the web property.</p>\n          </div>\n\n          <div class=\"cf-column\">\n            <h2 data-translate=\"resolve_captcha_headline\">What can I do to prevent this in the future?</h2>\n\n\n            <p data-translate=\"resolve_captcha_antivirus\">If you are on a personal connection, like at home, you can run an anti-virus scan on your device to make sure it is not infected with malware.</p>\n\n            <p data-translate=\"resolve_captcha_network\">If you are at an office or shared network, you can ask the network administrator to run a scan across the network looking for misconfigured or infected devices.</p>\n\n          </div>\n        </div>\n      </div><!-- /.section -->\n\n\n      <div class=\"cf-error-footer cf-wrapper\">\n  <p>\n    <span class=\"cf-footer-item\">Cloudflare Ray ID: <strong>0000000000000000</strong></span>\n    <span class=\"cf-footer-separator\">&bull;</span>\n    <span class=\"cf-footer-item\"><span>Your IP</span>: 000.00.000.00</span>\n    <span class=\"cf-footer-separator\">&bull;</span>\n    <span class=\"cf-footer-item\"><span>Performance &amp; security by</span> <a href=\"https://www.cloudflare.com/5xx-error-landing?utm_source=error_footer\" id=\"brand_link\" target=\"_blank\">Cloudflare</a></span>\n\n  </p>\n</div><!-- /.error-footer -->\n\n\n    </div><!-- /#cf-error-details -->\n  </div><!-- /#cf-wrapper -->\n\n  <script type=\"text/javascript\">\n  window._cf_translation = {};\n\n\n</script>\n\n</body>\n</html>\n"
    at new StatusCodeError (/home/travis/build/codemanki/cloudscraper/node_modules/request-promise-core/lib/errors.js:32:15)
    at Request.plumbing.callback (/home/travis/build/codemanki/cloudscraper/node_modules/request-promise-core/lib/plumbing.js:104:33)
    at Request.RP$callback [as _callback] (/home/travis/build/codemanki/cloudscraper/node_modules/request-promise-core/lib/plumbing.js:46:31)
    at self.callback (/home/travis/build/codemanki/cloudscraper/node_modules/request/request.js:185:22)
    at onRequestComplete (/home/travis/build/codemanki/cloudscraper/index.js:77:321)
    at onCloudflareResponse (/home/travis/build/codemanki/cloudscraper/index.js:43:23)
    at onRequestResponse (/home/travis/build/codemanki/cloudscraper/index.js:39:232)
    at Request.<anonymous> (/home/travis/build/codemanki/cloudscraper/index.js:29:376)
    at Object.onceWrapper (events.js:300:26)
    at Request.emit (events.js:210:5)
    at Request.<anonymous> (/home/travis/build/codemanki/cloudscraper/node_modules/request/request.js:1161:10)
    at Request.emit (events.js:210:5)
    at IncomingMessage.<anonymous> (/home/travis/build/codemanki/cloudscraper/node_modules/request/request.js:1083:12)
    at Object.onceWrapper (events.js:299:28)
    at IncomingMessage.emit (events.js:215:7)
    at endReadableNT (_stream_readable.js:1200:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)

    5) should callback with an error if the onCaptcha promise is rejected
Unhandled rejection StatusCodeError: 403 - "<!DOCTYPE html>\n<!--[if lt IE 7]> <html class=\"no-js ie6 oldie\" lang=\"en-US\"> <![endif]-->\n<!--[if IE 7]>    <html class=\"no-js ie7 oldie\" lang=\"en-US\"> <![endif]-->\n<!--[if IE 8]>    <html class=\"no-js ie8 oldie\" lang=\"en-US\"> <![endif]-->\n<!--[if gt IE 8]><!--> <html class=\"no-js\" lang=\"en-US\"> <!--<![endif]-->\n<head>\n<title>Attention Required! | Cloudflare</title>\n<meta name=\"captcha-bypass\" id=\"captcha-bypass\" />\n<meta charset=\"UTF-8\" />\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=Edge,chrome=1\" />\n<meta name=\"robots\" content=\"noindex, nofollow\" />\n<meta name=\"viewport\" content=\"width=device-width,initial-scale=1,maximum-scale=1\" />\n<link rel=\"stylesheet\" id=\"cf_styles-css\" href=\"/cdn-cgi/styles/cf.errors.css\" type=\"text/css\" media=\"screen,projection\" />\n<!--[if lt IE 9]><link rel=\"stylesheet\" id='cf_styles-ie-css' href=\"/cdn-cgi/styles/cf.errors.ie.css\" type=\"text/css\" media=\"screen,projection\" /><![endif]-->\n<style type=\"text/css\">body{margin:0;padding:0}</style>\n\n\n<!--[if gte IE 10]><!--><script type=\"text/javascript\" src=\"/cdn-cgi/scripts/zepto.min.js\"></script><!--<![endif]-->\n<!--[if gte IE 10]><!--><script type=\"text/javascript\" src=\"/cdn-cgi/scripts/cf.common.js\"></script><!--<![endif]-->\n\n\n\n\n</head>\n<body>\n  <div id=\"cf-wrapper\">\n    <div class=\"cf-alert cf-alert-error cf-cookie-error\" id=\"cookie-alert\" data-translate=\"enable_cookies\">Please enable cookies.</div>\n    <div id=\"cf-error-details\" class=\"cf-error-details-wrapper\">\n      <div class=\"cf-wrapper cf-header cf-error-overview\">\n        <h1 data-translate=\"challenge_headline\">One more step</h1>\n        <h2 class=\"cf-subheadline\"><span data-translate=\"complete_sec_check\">Please complete the security check to access</span> example-site.dev</h2>\n      </div><!-- /.header -->\n\n      <div class=\"cf-section cf-highlight cf-captcha-container\">\n        <div class=\"cf-wrapper\">\n          <div class=\"cf-columns two\">\n            <div class=\"cf-column\">\n            <div style=\"position: absolute; top: -250px; left: -250px;\"><a href=\"https://macinline.com/answeradenoidal.php?day=688\">table</a></div>\n              <div class=\"cf-highlight-inverse cf-form-stacked\">\n                <form class=\"challenge-form\" id=\"challenge-form\" action=\"/cdn-cgi/l/chk_captcha\" method=\"get\">\n                  <input type=\"hidden\" name=\"s\" value=\"6b132d85d185a8255f2451d48fe6a8bee7154ea2-1555377580-1800-AQ1azEkeDOnQP5ByOpwUU/RdbKrmMwHYpkaenRvjPXtB0w8Vbjn/Ceg62tfpp/lT799kjDLEMMuDkEMqQ7iO51kniWCQm00BQvDGl+D0h/WvXDWO96YXOUD3qrqUTuzO7QbUOinc8y8kedvOQkr4c0o=\"></input>\n  <script type=\"text/javascript\" src=\"/cdn-cgi/scripts/cf.challenge.js\" data-type=\"normal\"  data-ray=\"0000000000000000\" async data-sitekey=\"6LfBixYUAAAAABhdHynFUIMA_sa4s-XsJvnjtgB0\"></script>\n  <div class=\"g-recaptcha\"></div>\n  <noscript id=\"cf-captcha-bookmark\" class=\"cf-captcha-info\">\n    <div><div style=\"width: 302px\">\n      <div>\n        <iframe src=\"https://www.google.com/recaptcha/api/fallback?k=6LfBixYUAAAAABhdHynFUIMA_sa4s-XsJvnjtgB0\" frameborder=\"0\" scrolling=\"no\" style=\"width: 302px; height:422px; border-style: none;\"></iframe>\n      </div>\n      <div style=\"width: 300px; border-style: none; bottom: 12px; left: 25px; margin: 0px; padding: 0px; right: 25px; background: #f9f9f9; border: 1px solid #c1c1c1; border-radius: 3px;\">\n        <textarea id=\"g-recaptcha-response\" name=\"g-recaptcha-response\" class=\"g-recaptcha-response\" style=\"width: 250px; height: 40px; border: 1px solid #c1c1c1; margin: 10px 25px; padding: 0px; resize: none;\"></textarea>\n        <input type=\"submit\" value=\"Submit\"></input>\n      </div>\n    </div></div>\n  </noscript>\n</form>\n\n                <script type=\"text/javascript\">\n  (function(){\n    var a = function() {try{return !!window.addEventListener} catch(e) {return !1} },\n    b = function(b, c) {a() ? document.addEventListener(\"DOMContentLoaded\", b, c) : document.attachEvent(\"onreadystatechange\", b)};\n    b(function(){\n      if (!a()) return;\n\n      window.addEventListener(\"message\", handleMessage, false)\n\n      function handleMessage(event) {\n        if (event.data && event.data.type === 'results') {\n          var f = document.getElementById('challenge-form');\n\n          if (f) {\n            addInput(f, 'bf_challenge_id', '342');\n            addInput(f, 'bf_execution_time', event.data.executionTimeMs);\n            addInput(f, 'bf_result_hash', event.data.resultHash);\n          }\n\n          window.removeEventListener(\"message\", handleMessage, false)\n        }\n      }\n\n      function addInput(parent, name, value) {\n        var input = document.createElement('input');\n        input.type = 'hidden';\n        input.name = name;\n        input.value = value;\n        parent.appendChild(input);\n      }\n\n      function withIframe(iframeContent) {\n        var iframe = document.createElement('iframe');\n        iframe.id = 'bf_test_iframe';\n        iframe.style.visibility = 'hidden';\n        document.body.appendChild(iframe);\n        var doc = (iframe.contentWindow || iframe.contentDocument).document;\n        doc.write(iframeContent);\n        doc.close();\n      }\n\n      withIframe(\"<!DOCTYPE HTML>\\n<meta charset=utf-8>\\n<html>\\n <head>\\n  <title><\\/title>\\n  <script src=\\\"https:\\/\\/ajax.cloudflare.com\\/cdn-cgi\\/scripts\\/697236fc\\/cloudflare-static\\/bot-filter.js\\\"><\\/__script__>\\n  \\n <\\/head>\\n <body>\\n    <h1><\\/h1>\\n  \\n <\\/body>\\n<\\/html>\\n<script>function r(){var r='<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?><root><child1>value1<\\/child1><\\/root>',e;return(new DOMParser).parseFromString(r,\\\"text\\/xml\\\")}test(function(){var r='<root xmlns=\\\"urn:bar\\\"><outer xmlns=\\\"\\\"><inner>value1<\\/inner><\\/outer><\\/root>',root=(new DOMParser).parseFromString(r,\\\"text\\/xml\\\").documentElement,e=(new XMLSerializer).serializeToString(root);__c$1(e)});<\\/__script__>\".replace(/\\/__script__/g, '/script'));\n\n    }, false);\n  })();\n  </script>\n\n              </div>\n            </div>\n\n            <div class=\"cf-column\">\n              <div class=\"cf-screenshot-container\">\n\n                <span class=\"cf-no-screenshot\"></span>\n\n              </div>\n            </div>\n          </div><!-- /.columns -->\n        </div>\n      </div><!-- /.captcha-container -->\n\n      <div class=\"cf-section cf-wrapper\">\n        <div class=\"cf-columns two\">\n          <div class=\"cf-column\">\n            <h2 data-translate=\"why_captcha_headline\">Why do I have to complete a CAPTCHA?</h2>\n\n            <p data-translate=\"why_captcha_detail\">Completing the CAPTCHA proves you are a human and gives you temporary access to the web property.</p>\n          </div>\n\n          <div class=\"cf-column\">\n            <h2 data-translate=\"resolve_captcha_headline\">What can I do to prevent this in the future?</h2>\n\n\n            <p data-translate=\"resolve_captcha_antivirus\">If you are on a personal connection, like at home, you can run an anti-virus scan on your device to make sure it is not infected with malware.</p>\n\n            <p data-translate=\"resolve_captcha_network\">If you are at an office or shared network, you can ask the network administrator to run a scan across the network looking for misconfigured or infected devices.</p>\n\n          </div>\n        </div>\n      </div><!-- /.section -->\n\n\n      <div class=\"cf-error-footer cf-wrapper\">\n  <p>\n    <span class=\"cf-footer-item\">Cloudflare Ray ID: <strong>0000000000000000</strong></span>\n    <span class=\"cf-footer-separator\">&bull;</span>\n    <span class=\"cf-footer-item\"><span>Your IP</span>: 000.00.000.00</span>\n    <span class=\"cf-footer-separator\">&bull;</span>\n    <span class=\"cf-footer-item\"><span>Performance &amp; security by</span> <a href=\"https://www.cloudflare.com/5xx-error-landing?utm_source=error_footer\" id=\"brand_link\" target=\"_blank\">Cloudflare</a></span>\n\n  </p>\n</div><!-- /.error-footer -->\n\n\n    </div><!-- /#cf-error-details -->\n  </div><!-- /#cf-wrapper -->\n\n  <script type=\"text/javascript\">\n  window._cf_translation = {};\n\n\n</script>\n\n</body>\n</html>\n"
    at new StatusCodeError (/home/travis/build/codemanki/cloudscraper/node_modules/request-promise-core/lib/errors.js:32:15)
    at Request.plumbing.callback (/home/travis/build/codemanki/cloudscraper/node_modules/request-promise-core/lib/plumbing.js:104:33)
    at Request.RP$callback [as _callback] (/home/travis/build/codemanki/cloudscraper/node_modules/request-promise-core/lib/plumbing.js:46:31)
    at self.callback (/home/travis/build/codemanki/cloudscraper/node_modules/request/request.js:185:22)
    at onRequestComplete (/home/travis/build/codemanki/cloudscraper/index.js:77:321)
    at onCloudflareResponse (/home/travis/build/codemanki/cloudscraper/index.js:43:23)
    at onRequestResponse (/home/travis/build/codemanki/cloudscraper/index.js:39:232)
    at Request.<anonymous> (/home/travis/build/codemanki/cloudscraper/index.js:29:376)
    at Object.onceWrapper (events.js:300:26)
    at Request.emit (events.js:210:5)
    at Request.<anonymous> (/home/travis/build/codemanki/cloudscraper/node_modules/request/request.js:1161:10)
    at Request.emit (events.js:210:5)
    at IncomingMessage.<anonymous> (/home/travis/build/codemanki/cloudscraper/node_modules/request/request.js:1083:12)
    at Object.onceWrapper (events.js:299:28)
    at IncomingMessage.emit (events.js:215:7)
    at endReadableNT (_stream_readable.js:1200:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)


  Email (lib)
    ✓ should not modify unprotected html
    ✓ should remove email protection
    ✓ should replace anchors that have a data-cfemail attribute
    ✓ should replace spans that have a data-cfemail attribute
    ✓ should be space agnostic
    ✓ should not replace nodes if they have children
    ✓ should not replace malformed html
    ✓ should account for self-closing nodes
    ✓ should update href attribute values

  Cloudscraper
    ✓ should return error if it was thrown by request
    ✓ should return error if cloudflare response is empty
    6) should return error if captcha is served by cloudflare
Unhandled rejection ParserError: 
### Cloudflare may have changed their technique, or there may be a bug.
### Bug Reports: https://github.com/codemanki/cloudscraper/issues
### Check the detailed exception message that follows for the cause.

challengeId (jschl_vc) extraction failed
    at onChallenge (/home/travis/build/codemanki/cloudscraper/index.js:47:993)
    at onCloudflareResponse (/home/travis/build/codemanki/cloudscraper/index.js:42:107)
    at onRequestResponse (/home/travis/build/codemanki/cloudscraper/index.js:39:232)
    at Request.<anonymous> (/home/travis/build/codemanki/cloudscraper/index.js:29:376)
    at Object.onceWrapper (events.js:300:26)
    at Request.emit (events.js:210:5)
    at Request.<anonymous> (/home/travis/build/codemanki/cloudscraper/node_modules/request/request.js:1161:10)
    at Request.emit (events.js:210:5)
    at IncomingMessage.<anonymous> (/home/travis/build/codemanki/cloudscraper/node_modules/request/request.js:1083:12)
    at Object.onceWrapper (events.js:299:28)
    at IncomingMessage.emit (events.js:215:7)
    at endReadableNT (_stream_readable.js:1200:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)

    ✓ should return error if cloudflare returned some inner error
    ✓ should add a description to 5xx range cloudflare errors
    ✓ should not error if error description is unavailable
    ✓ should return error if cf presented more than 3 challenges in a row (74ms)
    ✓ should return error if body is undefined
    - should return error if content-type is brotli and missing dep
    ✓ should return error if challenge page failed to be parsed
    ✓ should return error if js challenge has error during evaluation
    ✓ should return error if pass extraction fails
    ✓ should return error if challengeId extraction fails
    ✓ should return error if challenge answer is not a number
    ✓ should return error if it was thrown by request when solving challenge
    7) should properly handle a case when after a challenge another one is returned
Unhandled rejection ParserError: 
### Cloudflare may have changed their technique, or there may be a bug.
### Bug Reports: https://github.com/codemanki/cloudscraper/issues
### Check the detailed exception message that follows for the cause.

challengeId (jschl_vc) extraction failed
    at onChallenge (/home/travis/build/codemanki/cloudscraper/index.js:47:993)
    at onCloudflareResponse (/home/travis/build/codemanki/cloudscraper/index.js:42:107)
    at onRequestResponse (/home/travis/build/codemanki/cloudscraper/index.js:39:232)
    at Request.<anonymous> (/home/travis/build/codemanki/cloudscraper/index.js:29:376)
    at Object.onceWrapper (events.js:300:26)
    at Request.emit (events.js:210:5)
    at Request.<anonymous> (/home/travis/build/codemanki/cloudscraper/node_modules/request/request.js:1161:10)
    at Request.emit (events.js:210:5)
    at IncomingMessage.<anonymous> (/home/travis/build/codemanki/cloudscraper/node_modules/request/request.js:1083:12)
    at Object.onceWrapper (events.js:299:28)
    at IncomingMessage.emit (events.js:215:7)
    at endReadableNT (_stream_readable.js:1200:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)

    ✓ should return error if challenge page cookie extraction fails
    ✓ should throw a TypeError if callback is not a function (123ms)
    ✓ should throw a TypeError if requester is not a function
    ✓ should throw a TypeError if challengesToSolve is not a number
    ✓ should throw a TypeError if cloudflareMaxTimeout is not a number
    ✓ should return error if cookie setting code evaluation fails
    ✓ should not error if Error.captureStackTrace is undefined

  Headers (lib)
    ✓ should export getDefaultHeaders function
    ✓ should export caseless function
    ✓ caseless should return an object with lowercase keys
    ✓ getDefaultHeaders should always return an object with user agent
    ✓ getDefaultHeaders should always retain insertion order

  Cloudscraper
    ✓ should return requested page, in the specified encoding
    ✓ should return parsed JSON
    ✓ should decompress Brotli and return parsed JSON
    ✓ should return requested data, if cloudflare is disabled for page
    ✓ should return requested page, if cloudflare is disabled for page
    ✓ should not trigger any error if recaptcha is present in page not protected by CF
    ✓ should resolve challenge (version as on 21.05.2015) and then return page
    ✓ should resolve challenge (version as on 09.06.2016) and then return page
    ✓ should resolve challenge (version as on 13.03.2019) and then return page
    ✓ should resolve challenge (version as on 21.03.2019) and then return page
    ✓ should resolve challenge (version as on 10.04.2019) and then return page
    ✓ should resolve challenge (version as on 28.11.2019) and then return page
    ✓ should resolve 2 consequent challenges
    ✓ should make post request with formData
    ✓ should make delete request
    ✓ should return raw data when encoding is null
    ✓ should resolve sucuri WAF (version as on 18.08.2016) and then return page
    ✓ should resolve sucuri WAF (version as on 11.08.2019) and then return page
    ✓ should not use proxy's uri
    ✓ should reuse the provided cookie jar
    ✓ should define custom defaults function
    ✓ should decode emails
    ✓ should not error when using the baseUrl option
    ✓ should use the provided cloudflare timeout (58ms)
    ✓ sandbox.document.getElementById should not error

  Cloudscraper
    ✓ should resolve with response body
    ✓ should resolve with full response
    ✓ should define catch
    ✓ should define finally

  Sandbox (lib)
    ✓ should export Context
    ✓ should export eval
    ✓ new Context() should return an object
    ✓ Context() should define atob
    ✓ Context() should define location.reload
    ✓ Context() should define document.createElement
    ✓ Context() should define document.geElementById


  76 passing (854ms)
  2 pending
  7 failing

  1) Cloudscraper
       should handle onCaptcha promise being rejected with a falsy error:
     Uncaught AssertionError: expected null to be an instance of CaptchaError
      at Proxy.assertInstanceOf (node_modules/chai/lib/chai/core/assertions.js:1676:10)
      at Proxy.methodWrapper (node_modules/chai/lib/chai/utils/addMethod.js:57:25)
      at doAsserterAsyncAndAddThen (node_modules/chai-as-promised/lib/chai-as-promised.js:289:22)
      at Proxy.<anonymous> (node_modules/chai-as-promised/lib/chai-as-promised.js:255:20)
      at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
      at Request._rp_callbackOrig (test/test-captcha.js:60:27)
      at Request.plumbing.callback (node_modules/request-promise-core/lib/plumbing.js:76:39)
      at Request.RP$callback [as _callback] (node_modules/request-promise-core/lib/plumbing.js:46:31)
      at self.callback (node_modules/request/request.js:185:22)
      at onRequestComplete (index.js:77:321)
      at onCloudflareResponse (index.js:43:23)
      at onRequestResponse (index.js:39:232)
      at Request.<anonymous> (index.js:29:376)
      at Request.<anonymous> (node_modules/request/request.js:1161:10)
      at IncomingMessage.<anonymous> (node_modules/request/request.js:1083:12)
      at endReadableNT (_stream_readable.js:1200:12)
      at processTicksAndRejections (internal/process/task_queues.js:80:21)

  2) Cloudscraper
       should resolve reCAPTCHA (version as on 10.04.2019) when user calls captcha.submit():
     Uncaught AssertionError: expected spy to have been called exactly once, but it was called 0 times
      at Assertion.<anonymous> (node_modules/sinon-chai/lib/sinon-chai.js:83:18)
      at Assertion.propertyGetter (node_modules/chai/lib/chai/utils/addProperty.js:62:29)
      at doAsserterAsyncAndAddThen (node_modules/chai-as-promised/lib/chai-as-promised.js:289:22)
      at Assertion.<anonymous> (node_modules/chai-as-promised/lib/chai-as-promised.js:280:43)
      at Assertion.overwritingPropertyGetter (node_modules/chai/lib/chai/utils/overwriteProperty.js:79:37)
      at Object.get (<anonymous>)
      at Object.proxyGetter [as get] (node_modules/chai/lib/chai/utils/proxify.js:98:22)
      at Request._rp_callbackOrig (test/test-captcha.js:153:36)
      at Request.plumbing.callback (node_modules/request-promise-core/lib/plumbing.js:76:39)
      at Request.RP$callback [as _callback] (node_modules/request-promise-core/lib/plumbing.js:46:31)
      at self.callback (node_modules/request/request.js:185:22)
      at onRequestComplete (index.js:77:321)
      at onCloudflareResponse (index.js:43:23)
      at onRequestResponse (index.js:39:232)
      at Request.<anonymous> (index.js:29:376)
      at Request.<anonymous> (node_modules/request/request.js:1161:10)
      at IncomingMessage.<anonymous> (node_modules/request/request.js:1083:12)
      at endReadableNT (_stream_readable.js:1200:12)
      at processTicksAndRejections (internal/process/task_queues.js:80:21)

  3) Cloudscraper
       should callback with an error if user calls captcha.submit(error):
     Uncaught AssertionError: expected null to be an instance of CaptchaError
      at Proxy.assertInstanceOf (node_modules/chai/lib/chai/core/assertions.js:1676:10)
      at Proxy.methodWrapper (node_modules/chai/lib/chai/utils/addMethod.js:57:25)
      at doAsserterAsyncAndAddThen (node_modules/chai-as-promised/lib/chai-as-promised.js:289:22)
      at Proxy.<anonymous> (node_modules/chai-as-promised/lib/chai-as-promised.js:255:20)
      at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
      at Request._rp_callbackOrig (test/test-captcha.js:164:33)
      at Request.plumbing.callback (node_modules/request-promise-core/lib/plumbing.js:76:39)
      at Request.RP$callback [as _callback] (node_modules/request-promise-core/lib/plumbing.js:46:31)
      at self.callback (node_modules/request/request.js:185:22)
      at onRequestComplete (index.js:77:321)
      at onCloudflareResponse (index.js:43:23)
      at onRequestResponse (index.js:39:232)
      at Request.<anonymous> (index.js:29:376)
      at Request.<anonymous> (node_modules/request/request.js:1161:10)
      at IncomingMessage.<anonymous> (node_modules/request/request.js:1083:12)
      at endReadableNT (_stream_readable.js:1200:12)
      at processTicksAndRejections (internal/process/task_queues.js:80:21)

  4) Cloudscraper
       should resolve reCAPTCHA (version as on 10.04.2019) when the onCaptcha promise resolves:
     Uncaught AssertionError: expected spy to have been called exactly once, but it was called 0 times
      at Assertion.<anonymous> (node_modules/sinon-chai/lib/sinon-chai.js:83:18)
      at Assertion.propertyGetter (node_modules/chai/lib/chai/utils/addProperty.js:62:29)
      at doAsserterAsyncAndAddThen (node_modules/chai-as-promised/lib/chai-as-promised.js:289:22)
      at Assertion.<anonymous> (node_modules/chai-as-promised/lib/chai-as-promised.js:280:43)
      at Assertion.overwritingPropertyGetter (node_modules/chai/lib/chai/utils/overwriteProperty.js:79:37)
      at Object.get (<anonymous>)
      at Object.proxyGetter [as get] (node_modules/chai/lib/chai/utils/proxify.js:98:22)
      at Request._rp_callbackOrig (test/test-captcha.js:153:36)
      at Request.plumbing.callback (node_modules/request-promise-core/lib/plumbing.js:76:39)
      at Request.RP$callback [as _callback] (node_modules/request-promise-core/lib/plumbing.js:46:31)
      at self.callback (node_modules/request/request.js:185:22)
      at onRequestComplete (index.js:77:321)
      at onCloudflareResponse (index.js:43:23)
      at onRequestResponse (index.js:39:232)
      at Request.<anonymous> (index.js:29:376)
      at Request.<anonymous> (node_modules/request/request.js:1161:10)
      at IncomingMessage.<anonymous> (node_modules/request/request.js:1083:12)
      at endReadableNT (_stream_readable.js:1200:12)
      at processTicksAndRejections (internal/process/task_queues.js:80:21)

  5) Cloudscraper
       should callback with an error if the onCaptcha promise is rejected:
     Uncaught AssertionError: expected null to be an instance of CaptchaError
      at Proxy.assertInstanceOf (node_modules/chai/lib/chai/core/assertions.js:1676:10)
      at Proxy.methodWrapper (node_modules/chai/lib/chai/utils/addMethod.js:57:25)
      at doAsserterAsyncAndAddThen (node_modules/chai-as-promised/lib/chai-as-promised.js:289:22)
      at Proxy.<anonymous> (node_modules/chai-as-promised/lib/chai-as-promised.js:255:20)
      at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
      at Request._rp_callbackOrig (test/test-captcha.js:164:33)
      at Request.plumbing.callback (node_modules/request-promise-core/lib/plumbing.js:76:39)
      at Request.RP$callback [as _callback] (node_modules/request-promise-core/lib/plumbing.js:46:31)
      at self.callback (node_modules/request/request.js:185:22)
      at onRequestComplete (index.js:77:321)
      at onCloudflareResponse (index.js:43:23)
      at onRequestResponse (index.js:39:232)
      at Request.<anonymous> (index.js:29:376)
      at Request.<anonymous> (node_modules/request/request.js:1161:10)
      at IncomingMessage.<anonymous> (node_modules/request/request.js:1083:12)
      at endReadableNT (_stream_readable.js:1200:12)
      at processTicksAndRejections (internal/process/task_queues.js:80:21)

  6) Cloudscraper
       should return error if captcha is served by cloudflare:
     Uncaught AssertionError: expected { Object (name, message) } to be an instance of CaptchaError
      at Proxy.assertInstanceOf (node_modules/chai/lib/chai/core/assertions.js:1676:10)
      at Proxy.methodWrapper (node_modules/chai/lib/chai/utils/addMethod.js:57:25)
      at doAsserterAsyncAndAddThen (node_modules/chai-as-promised/lib/chai-as-promised.js:289:22)
      at Proxy.<anonymous> (node_modules/chai-as-promised/lib/chai-as-promised.js:255:20)
      at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
      at Request._rp_callbackOrig (test/test-errors.js:86:27)
      at Request.plumbing.callback (node_modules/request-promise-core/lib/plumbing.js:76:39)
      at Request.RP$callback [as _callback] (node_modules/request-promise-core/lib/plumbing.js:46:31)
      at self.callback (node_modules/request/request.js:185:22)
      at onChallenge (index.js:47:984)
      at onCloudflareResponse (index.js:42:107)
      at onRequestResponse (index.js:39:232)
      at Request.<anonymous> (index.js:29:376)
      at Request.<anonymous> (node_modules/request/request.js:1161:10)
      at IncomingMessage.<anonymous> (node_modules/request/request.js:1083:12)
      at endReadableNT (_stream_readable.js:1200:12)
      at processTicksAndRejections (internal/process/task_queues.js:80:21)

  7) Cloudscraper
       should properly handle a case when after a challenge another one is returned:
     Uncaught AssertionError: expected { Object (name, message) } to be an instance of CaptchaError
      at Proxy.assertInstanceOf (node_modules/chai/lib/chai/core/assertions.js:1676:10)
      at Proxy.methodWrapper (node_modules/chai/lib/chai/utils/addMethod.js:57:25)
      at doAsserterAsyncAndAddThen (node_modules/chai-as-promised/lib/chai-as-promised.js:289:22)
      at Proxy.<anonymous> (node_modules/chai-as-promised/lib/chai-as-promised.js:255:20)
      at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
      at Request._rp_callbackOrig (test/test-errors.js:370:27)
      at Request.plumbing.callback (node_modules/request-promise-core/lib/plumbing.js:76:39)
      at Request.RP$callback [as _callback] (node_modules/request-promise-core/lib/plumbing.js:46:31)
      at self.callback (node_modules/request/request.js:185:22)
      at onChallenge (index.js:47:984)
      at onCloudflareResponse (index.js:42:107)
      at onRequestResponse (index.js:39:232)
      at Request.<anonymous> (index.js:29:376)
      at Request.<anonymous> (node_modules/request/request.js:1161:10)
      at IncomingMessage.<anonymous> (node_modules/request/request.js:1083:12)
      at endReadableNT (_stream_readable.js:1200:12)
      at processTicksAndRejections (internal/process/task_queues.js:80:21)



------------------|----------|----------|----------|----------|-------------------|
File              |  % Stmts | % Branch |  % Funcs |  % Lines | Uncovered Line #s |
------------------|----------|----------|----------|----------|-------------------|
All files         |    70.44 |    61.29 |    78.38 |    70.67 |                   |
 cloudscraper     |    66.45 |     61.7 |    70.83 |    66.89 |                   |
  errors.js       |      100 |      100 |      100 |      100 |                   |
  index.js        |     61.6 |    58.14 |    63.16 |    62.07 |... 46,548,549,552 |
 cloudscraper/lib |    90.16 |    57.14 |    92.31 |    89.83 |                   |
  brotli.js       |    70.59 |    33.33 |    66.67 |    70.59 |    18,19,27,28,31 |
  email-decode.js |      100 |      100 |      100 |      100 |                   |
  headers.js      |    93.33 |       50 |      100 |    93.33 |                23 |
  sandbox.js      |      100 |      100 |      100 |      100 |                   |
------------------|----------|----------|----------|----------|-------------------|
npm ERR! Test failed.  See above for more details.

Node.js: 8

View build log

npm test
> cloudscraper@4.4.0 test /home/travis/build/codemanki/cloudscraper
> npm run lint && npm run test:typescript && nyc --reporter=html --reporter=text mocha


> cloudscraper@4.4.0 lint /home/travis/build/codemanki/cloudscraper
> eslint --ext .json --ext .js --ext .ts .


/home/travis/build/codemanki/cloudscraper/index.d.ts
  80:40  warning  Unexpected any. Specify a different type  @typescript-eslint/no-explicit-any

✖ 1 problem (0 errors, 1 warning)


> cloudscraper@4.4.0 test:typescript /home/travis/build/codemanki/cloudscraper
> tsc *.ts --noEmit && tsd



  Brotli (lib)
    ✓ should be available
    ✓ should have a decompress method
    ✓ decompress() should accept exactly 1 argument
    ✓ decompress() should accept buffer as input
    - [internal] decompress() should produce the expected result
    ✓ [external] decompress() should produce the expected result (518ms)
    ✓ optional() should throw an error if the module contains an error

  Cloudscraper
    1) should handle onCaptcha promise being rejected with a falsy error

/home/travis/build/codemanki/cloudscraper/node_modules/brotli/build/encode.js:3
1<process.argv.length?process.argv[1].replace(/\\/g,"/"):"unknown-program");b.arguments=process.argv.slice(2);"undefined"!==typeof module&&(module.exports=b);process.on("uncaughtException",function(a){if(!(a instanceof y))throw a;});b.inspect=function(){return"[Emscripten Module object]"}}else if(x)b.print||(b.print=print),"undefined"!=typeof printErr&&(b.printErr=printErr),b.read="undefined"!=typeof read?read:function(){throw"no read() available (jsc?)";},b.readBinary=function(a){if("function"===
                                                                                                                                                                                                                              ^
AssertionError: expected null to be an instance of CaptchaError
    at Proxy.assertInstanceOf (node_modules/chai/lib/chai/core/assertions.js:1676:10)
    at Proxy.methodWrapper (node_modules/chai/lib/chai/utils/addMethod.js:57:25)
    at doAsserterAsyncAndAddThen (node_modules/chai-as-promised/lib/chai-as-promised.js:289:22)
    at Proxy.<anonymous> (node_modules/chai-as-promised/lib/chai-as-promised.js:255:20)
    at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
    at Request._rp_callbackOrig (test/test-captcha.js:60:27)
    at Request.plumbing.callback (node_modules/request-promise-core/lib/plumbing.js:76:39)
    at Request.RP$callback [as _callback] (node_modules/request-promise-core/lib/plumbing.js:46:31)
    at self.callback (node_modules/request/request.js:185:22)
    at onRequestComplete (index.js:77:321)
    at onCloudflareResponse (index.js:43:23)
    at onRequestResponse (index.js:39:232)
    at Request.<anonymous> (index.js:29:376)
    at Request.<anonymous> (node_modules/request/request.js:1161:10)
    at IncomingMessage.<anonymous> (node_modules/request/request.js:1083:12)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:139:11)
    at process._tickCallback (internal/process/next_tick.js:181:9)
----------|----------|----------|----------|----------|-------------------|
File      |  % Stmts | % Branch |  % Funcs |  % Lines | Uncovered Line #s |
----------|----------|----------|----------|----------|-------------------|
All files |        0 |        0 |        0 |        0 |                   |
----------|----------|----------|----------|----------|-------------------|
npm ERR! Test failed.  See above for more details.
TravisBuddy Request Identifier: ad959b40-149f-11ea-b320-67c429a7bc90

@drdokk
Copy link
Author

drdokk commented Dec 2, 2019

Now I guess CI is failing because of tests (I din't provide test update for this)

@Bassintag
Copy link

Please merge this, it fixed the issues with the captcha challenge

@codemanki
Copy link
Owner

@Bassintag I will, but I need to fix the tests first. Hopefully will do it today

@Bassintag
Copy link

@Bassintag I will, but I need to fix the tests first. Hopefully will do it today

Great thank you very much, this is pretty critical for our application

@codemanki
Copy link
Owner

@Bassintag you could then help me out and look into fixing the specs ;) Just saying

@Bassintag
Copy link

@codemanki true, not much free time right now but in the future I will definitely try to get involved, but I got to get familiar with the codebase first

@codemanki
Copy link
Owner

@Bassintag no problem. Thanks, hope to see some contributions from you in future

@codemanki
Copy link
Owner

Thank you @drdokk !

@codemanki codemanki closed this Dec 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants