Note how to download files with selenium + python + chrome
If you set as below, it will be downloaded to the [Download path]!
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
options = Options()
driver = webdriver.Chrome(chrome_options=options)
driver.command_executor._commands["send_command"] = (
"POST",
'/session/$sessionId/chromium/send_command'
)
params = {
'cmd': 'Page.setDownloadBehavior',
'params': {
'behavior': 'allow',
'downloadPath':[Download path]
}
}
driver.execute("send_command", params=params)
Recommended Posts