微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

找不到变量:phantomjs 中的 __d

如何解决找不到变量:phantomjs 中的 __d

当我在 phantomjs 中使用用户代理时,我得到找不到变量:__d

https://www.instagram.com/static/bundles/es6/en_US.js/df044fc58080.js:1 在全局代码

sombedy 能帮我吗??

我希望我可以在这里学习或获得一些经验

windows 10 phantomjs 2.1.1 shouladi 使用一些 webdriver??,因为我在网上读到很多讨论 abot selenium 或其他 webdriver

怎么了??

var page = webPage.create();

page.viewportSize = {width: 1280,height: 1024};

var testindex = 0,loadInProgress = false;

// page.settings.userAgent =  "Mozilla/5.0 (Linux; Android 10; SM-G975U) AppleWebKit/537.36 (KHTML,like Gecko) Chrome/79.0.3945.93 Mobile Safari/537.36";
page.settings.userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebkit/537.36 (KHTML,like Gecko) Chrome/84.04147.105 Safari/537.36";
// browser = webdriver.PhantomJS()

page.onLoadStarted = function() {
  loadInProgress = true;
  console.log("load started");
};

page.onLoadFinished = function() {
  loadInProgress = false;
  console.log("load finished");
};

function load()
{
    page.open("https://instagram.com/",function(status){
      if(status ==="succes"){
        page.render('1coba.jpeg',{format:'jpeg',quality:'100'});
        page.evaluate(function(){
          document.getElementById("m_login_email").value="farhan_hakim007@yahoo.com";
          document.getElementById("m_login_password").value="hanhakim16\u000d"
          // document.getElementsByClassName("_54k8 _52jh _56bs _56b_ _28lf _9cow _56bw _56bu").submit();
        });
        
      }else{
        page.render('1coba.jpeg',quality:'100'});
        page.evaluate(function(){
          document.querySelector('.ablfq').click();
          document.querySelector("._2hvTZ ").value="m.aajja\u0009akumaho09\u000d";
          // document.querySelector("m_login_password").value="hanhakim16"
          document.querySelector('._54k8 ').click();
          // document.getElementById("checkpointSubmitButton-actual-button").click();
        });
      }
      
    })  
}
function upload()
{
    page.uploadFile('.q02Nz','/E:/shit!!/maja.jpg');    
    page.render("2coba.jpeg")
}

function finish()
{
  page.render('3coba.jpeg',quality:'100'});
}

var steps = [
    load,upload,finish
]

interval = setInterval(function() {
  if (!loadInProgress && typeof steps[testindex] == "function") {
    console.log("step " + (testindex + 1));
    steps[testindex]();
    testindex++;
  }
  if (typeof steps[testindex] != "function") {
    console.log("test complete!");
    phantom.exit();
  }
},2000);    

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。