操纵木偶的页面。getFrameTree”定义中并没有被发现

时间:2022-12-20 19:24:26

Receiving

接收

error : Protocol error (Page.getFrameTree): 'Page.getFrameTree' wasn't found undefined

错误:协议错误(Page. getframetree): 'Page。getFrameTree”定义中并没有被发现

When attempting to run use puppeteer in chrome (also not headless), it works if executablePath is removed. Note also (for some reason) disable infobars isn't working in chrome & neither is setting the viewport

当试图在chrome中运行使用操纵器(也不是headless)时,如果删除了executablePath,它就会起作用。还请注意(由于某些原因)禁用infobars在chrome中不能工作,也不能设置viewport

Versions of Things

版本的东西

node v8.9.3

节点v8.9.3

Chrome Version 63.0.3239.84

Chrome版本63.0.3239.84

puppeteer v 0.13.0

操纵木偶的v 0.13.0

OS: Windows 10 Pro

操作系统:Windows 10 Pro

For the following code:

对于下面的代码:

const puppeteer = require("puppeteer");

puppeteer.launch(options = {
args: ['--disable-infobars']
});
// ^ Also not working.
(async() => {

const browser = await puppeteer.launch({
    headless: false,
    args: ['--remote-debugging-port=9222'],
    executablePath: "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe",
    setViewport: {width: 1920, height: 1080},
});
// ^ Viewport also isn't working

try{
    const gitPage = await browser.newPage();
    await gitPage.setViewport({width: 1024, height: 768});
    await gitPage.goto("https://github.com/login", {waitUntil: 'networkidle2'});
    await gitPage.type("#login_field", "CaptainPlanet", {delay: 100});
    await gitPage.type("#password", "NPH_Andrews", {delay: 100});
    const btnLogin = await gitPage.$("input[tabindex='3']");
    await btnLogin.click();
}catch(err) {
  console.log("error: " + err.message);
}    


})();

1 个解决方案

#1


2  

This issue occurs when using the wrong version of chromium.

当使用错误版本的铬时就会出现这个问题。

The release notes have the version of chromium you need to run, in your case:

发布说明中有您需要运行的chromium版本,在您的情况下:

Chromium 64.0.3264.0 (r515411)

铬64.0.3264.0(r515411)

https://github.com/GoogleChrome/puppeteer/releases

https://github.com/GoogleChrome/puppeteer/releases

#1


2  

This issue occurs when using the wrong version of chromium.

当使用错误版本的铬时就会出现这个问题。

The release notes have the version of chromium you need to run, in your case:

发布说明中有您需要运行的chromium版本,在您的情况下:

Chromium 64.0.3264.0 (r515411)

铬64.0.3264.0(r515411)

https://github.com/GoogleChrome/puppeteer/releases

https://github.com/GoogleChrome/puppeteer/releases