-
-
Notifications
You must be signed in to change notification settings - Fork 744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Warning: Plugin is not derived from PuppeteerExtraPlugin, ignoring." #503
Comments
|
|
Thanks @abokizh, |
Use Yarn to install "@next" packages instead of NPM |
Thanks @kasjp. I used yarn instead of npm and installed @extra/humanize@next. |
Thanks @kasjp again. it works for me. But I can not see mouse movement even though I added @extra/humanize plugin for puppeteer-extra. Can you help me? |
If you have loaded it in and added it through puppeteer.use(), you won't see it by default but it's there. Check docs on how to enable the cursor visibility. |
@kasjp My code is like the following But I can not see mouse cursor. it is weird. |
@micha1333 Have you tried creating a new page? The plugins usually initialize onPageCreated, so calling browser.newPage() should force the plugins to load in the new page. Try this // Load puppeteer
const puppeteer = require("puppeteer-extra");
//Load Humanize plugin
const HumanizePlugin = require("@extra/humanize");
//Load the plugin into puppeteer, show the cursor
puppeteer.use(
HumanizePlugin({
mouse: {
enabled: true,
showCursor: true
},
});
);
(async () => {
//Launch puppeteer
let browser = await puppeteer.launch();
//Get initial page
let [page] = await browser.pages();
//Create new page(this loads in plugins)
let page2 = await browser.newPage();
//close now not-needed first page
await page.close();
//do what you want with page2 now, I usually do this
page = page2;
})(); |
Hello everyone! Thanks for your comments on the issue, which allowed me to solve it on my side. Here's what I used:
|
I am facing the following error after the steps:
package.json {
"dependencies": {
"@extra/humanize": "^4.2.2-next.616",
"puppeteer": "^15.3.0",
"puppeteer-extra": "^3.1.16-next.149",
"puppeteer-extra-plugin-stealth": "^2.10.1"
}
} import { Browser, Page } from "puppeteer";
import puppeteer from "puppeteer-extra";
import StealthPlugin from "puppeteer-extra-plugin-stealth";
import HumanizePlugin from "@extra/humanize";
import { WebNavigator } from "./web-navigator";
puppeteer.use(StealthPlugin());
puppeteer.use(
HumanizePlugin({
mouse: {
enabled: true,
showCursor: true, // Show the cursor (meant for testing)
},
})
);
export class PuppeteerNavigator implements WebNavigator {
static async make(): Promise<PuppeteerNavigator> {
const browser = await puppeteer.launch({
// @ts-ignore
headless: false,
args: ["--no-sandbox", "--disable-setuid-sandbox"],
});
const page = await browser.newPage();
return new PuppeteerNavigator(browser, page);
}
constructor(private browser: Browser, private page: Page) {}
async navigateTo(url: string): Promise<void> {
await this.page.goto(url, { waitUntil: "networkidle0" });
}
async click(selector: string): Promise<void> {
try {
await this.page.waitForSelector(selector);
await this.page.click(selector);
} catch (error) {
console.log("ERROR:", error);
}
}
} Does anybody knows how to solve it? |
Where might I find the source for the humanize plugin? This looks like it might be it: https://github.com/berstend/puppeteer-extra/tree/automation-extra/packages/plugin-humanize |
Hello,
I have tried to add a plugin '@extra/humanize'.
But I got a warning as the following
Warning: Plugin is not derived from PuppeteerExtraPlugin, ignoring. HumanizePlugin {
_debugBase: [Function: debug] {
namespace: 'automation-extra-plugin:base:humanize',
useColors: true,
color: 3,
extend: [Function: extend],
destroy: [Function: deprecated],
enabled: [Getter/Setter],
inspectOpts: {}
},
_opts: { mouse: { enabled: true, showCursor: false } },
env: LauncherEnv { driverName: 'unknown', browserName: 'unknown' }
}
My code
const puppeteer = require('puppeteer-extra')
const HumanizePlugin =require('@extra/humanize')
puppeteer.use(HumanizePlugin())
Here is the link of the plugin
https://www.npmjs.com/package/@extra/humanize
The text was updated successfully, but these errors were encountered: