I'm using Playwright to analyze data from a remote site. However, at the first call to
page.goto(URL) # Initial URL
the server pops up a panel, as far as I can tell before any Javascript runs:
So far, the only solution I've found is to manually dismiss it. This is less than ideal since it means I can't run Playwright in headless mode.
Any suggestions?
You can use the launchOption configuration to disable the prompt.
module.exports = {
//other playwright related configuration
use: {
// Browser options
browserName: 'chromium',
channel: 'chrome',
headless: false,
launchOptions: { args: ['--deny-permission-prompts'] }, //use this option to disable the prompt
actionTimeout: 30 * 1000,
navigationTimeout: 90 * 1000,
},
}
`