Selenium not downloading report file in --headless mode

Viewed 46

I'm trying to download an excel file from a web report with a scraper. It runs perfectly when the navegator is displayed, but when I try it in headless mode i get this error. enter image description here

Any idea of what may be wrong? I'm using this options

opc.headless = True
opc.add_argument("--start-maximized")
opc.add_argument("--window-size=1920x1080")
opc.add_argument("--enable-features=NetworkService,NetworkServiceInProcess")
opc.add_argument("--disable-dev-shm-usage")
opc.add_argument("--disable-gpu")
opc.add_argument("--no-sandbox")
opc.add_argument("--ignore-certificate-errors")
opc.add_argument("--allow-running-insecure-content")
opc.add_argument("--disable-notifications")
opc.add_argument("--disable-blink-features")
opc.add_argument("--disable-blink-features=AutomationControlled")
opc.add_argument('--disable-dev-shm-usage')
opc.add_argument("--incognito")
opc.add_argument("--user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36")
opc.add_argument("--verbose")
opc.add_argument('enable-logging')
0 Answers
Related