Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jecogeo
Created June 24, 2021 20:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jecogeo/d1a69d120e6dcb427dc43233bb7364d7 to your computer and use it in GitHub Desktop.
Save jecogeo/d1a69d120e6dcb427dc43233bb7364d7 to your computer and use it in GitHub Desktop.
Baixa dados de COVID do Ministério da Saúde
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