agentic icon indicating copy to clipboard operation
agentic copied to clipboard

How to use Puppeteer `Page` class?

Open dawangraoming opened this issue 2 years ago • 2 comments

Describe the feature

After executing initSession, Puppeteer will be launched and a page will be created.

If I want to implement some custom events to solve the captcha problem, how can I get the Page class?

dawangraoming avatar Dec 27 '22 08:12 dawangraoming

This isn't supported by the library at the moment, though you're welcome to edit the source and expose the browser / page directly.

transitive-bullshit avatar Dec 28 '22 08:12 transitive-bullshit

Thanks for the reply

I just reviewed the 'initSession' function in chatgpt-api-browser.ts, this function has some built-in CAPTCHA processing, if need to keep it, I may need to add some optional parameters for initSession, like:

initSession({ afterPageCreated: (page) => { /* do something */ }})

What do u think?

dawangraoming avatar Dec 28 '22 09:12 dawangraoming

You're welcome to edit the source for this type of use case or access the _page property directly.

transitive-bullshit avatar Jan 22 '23 07:01 transitive-bullshit