Skip to content

Cookies management using Lightpanda #402

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

Open
benjibenoit opened this issue Feb 2, 2025 · 2 comments
Open

Cookies management using Lightpanda #402

benjibenoit opened this issue Feb 2, 2025 · 2 comments
Assignees
Labels
CDP Chrome Debug Protocol playwright

Comments

@benjibenoit
Copy link

Hi guys,

I was using the Playwrite chrome browser to scrape my website. I saw Lightpanda and wanted to give it a try. I get this error in my console:

Network.deleteCookies timed out. Increase the 'protocolTimeout' setting in launch/connect calls for a higher timeout if needed.

Is it because Lightpanda hasn't implemented it yet?

Thanks !

@krichprollsch krichprollsch self-assigned this Feb 3, 2025
@krichprollsch krichprollsch added CDP Chrome Debug Protocol playwright labels Feb 3, 2025
@krichprollsch
Copy link
Member

Hello @shankiflang!
Yes that's possible, indeed.

Could-you share your playwright script reproducing the issue?
Thanks!

@benjibenoit
Copy link
Author

Hello @shankiflang! Yes that's possible, indeed.

Could-you share your playwright script reproducing the issue? Thanks!

Hello, I can't share the code because it's a company code, but here's a summary:

const cookies = []
const headers = ""

this.browser = await puppeteer.connect({
  browserWSEndpoint: "ws://127.0.0.1:9222",
})

this.page = await this.browser.newPage()

await this.page.setCookie(cookies)
await this.page.setExtraHTTPHeaders(headers)

await this.page.goto(<link>, {
  waitUntil: 'networkidle2',
})

const updatedCookies = await this.page.cookies()

for (const updatedCookie of updatedCookies) {
  const { name, ...cookie } = updatedCookie
  <save-cookies-in-db>
}

if (this.browser) {
  await this.browser.close()
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CDP Chrome Debug Protocol playwright
Projects
None yet
Development

No branches or pull requests

2 participants