Python Playwright chromeのオプションを反映させる方法
うっす
備忘録てきな何かです
Contents
chromeのオプションを反映させる方法
def run():
with sync_playwright() as p:
#chrome option
options = [
"--disable-gpu",
"--no-sandbox",
"--disable-setuid-sandbox",
"--disable-webgl",
"--disable-popup-blocking",
'--disable-dev-shm-usage',
'--blink-settings=imagesEnabled=false',
'--lang=ja',
]
browser =p.chromium.launch(headless=True,channel="chrome",args=optinos)
context = browser.new_context()
page = context.new_page()
page.goto("https://音質派.com")
run()
launchくんのargs=にoptionを書けってことですね、たぶん。