Created
June 24, 2021 20:08
-
-
Save jecogeo/d1a69d120e6dcb427dc43233bb7364d7 to your computer and use it in GitHub Desktop.
Baixa dados de COVID do Ministério da Saúde
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium import webdriver | |
from selenium.webdriver.firefox.options import Options as FirefoxOptions | |
options = FirefoxOptions() | |
options.headless = True | |
# To prevent download dialog on firefox | |
profile = webdriver.FirefoxProfile() | |
profile.set_preference('browser.download.manager.showWhenStarting', False) | |
profile.set_preference('browser.helperApps.neverAsk.saveToDisk', | |
'application/x-rar-compressed, application/octet-stream, application/zip, application/octet-stream, application/x-zip-compressed, multipart/x-zip') | |
browser = webdriver.Firefox(profile, options=options) | |
browser.get("https://covid.saude.gov.br/") | |
browser.find_element_by_xpath("//ion-button[contains(text(),'Arquivo')]").click() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment