Skip to content

Instantly share code, notes, and snippets.

@brunogamacatao
Created March 30, 2020 13:03
Show Gist options
  • Save brunogamacatao/8028c8db0f688adc1d2ed7a42791e5a0 to your computer and use it in GitHub Desktop.
Save brunogamacatao/8028c8db0f688adc1d2ed7a42791e5a0 to your computer and use it in GitHub Desktop.
Obter dados publicos da COVID-19, do Ministério da Saúde, acumulados e atualizados
import http.client
import mimetypes
conn = http.client.HTTPSConnection("xx9p7hp1p7.execute-api.us-east-1.amazonaws.com")
payload = ''
headers = {
'authority': 'xx9p7hp1p7.execute-api.us-east-1.amazonaws.com',
'method': 'GET',
'path': '/prod/PortalAcumulo',
'scheme': 'https',
'accept': 'application/json, text/plain, */*',
'Accept-Encoding': 'zip, deflate, br',
'Accept-Language': 'en-US,en;q=0.9,pt;q=0.8,ja;q=0.7',
'origin': 'https://covid.saude.gov.b',
'referer': 'https://covid.saude.gov.br/?fbclid=IwAR1mlx1mFSxaMUfPXSso-TM936HNfW5ZOYnl48taVYmGmuoZLtNN5G7B-_o',
'sec-fetch-mode': 'cors',
'sec-fetch-size': 'cross-site',
'x-parse-application-id': 'unAFkcaNDeXajurGB7LChj8SgQYS2ptm'
}
conn.request("GET", "/prod/PortalAcumulo", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment