-
Notifications
You must be signed in to change notification settings - Fork 77
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
type of parameter page should be a class, not an interface. #21
Comments
|
框架会根据方法中的参数类型,通过反射机制从工厂类中实例化worker,看你提供的代码没有涉及到这一块,提供一下异常栈和更多代码我才好帮你 |
`import {Browser, LaunchOptions} from "puppeteer"; const puppeteer = require('puppeteer-extra'); export class UserWorkerFactory implements WorkerFactory { constructor(launchOptions?: LaunchOptions, proxyPool?: string|any) { workerType(): any { get(): Promise { release(worker: Page): Promise { shutdown(): any { ` |
现在的主要问题是,我不太清楚 ppspider 框架中是怎么获取然后使用这个page对象的, 之前用的无头模式是挺正常的, 然后我现在想用 puppeteer 中对页面进行自动化模拟测试, 您有自动化测试操作的示例么。我看现有的都是爬虫相关的示例 |
工厂类看起来没有问题,应该是声明任务的地方,参数没有设置正确的类型,导致page没有实例化成功 |
|
请问怎么在框架中使用page类,我使用ppspider中的page类的时候,一直连接失败,但是使用puppeteer 中的page类又一直报 type of parameter page should be a class, not an interface. 网上实在是找不到相关资料,热切期望您的回复
The text was updated successfully, but these errors were encountered: