Skip to content

Instantly share code, notes, and snippets.

@jimywork
Created May 29, 2019 19:08
Show Gist options
  • Save jimywork/94c1e8c3b46ba0394f3d903dff12b9ee to your computer and use it in GitHub Desktop.
Save jimywork/94c1e8c3b46ba0394f3d903dff12b9ee to your computer and use it in GitHub Desktop.
import urllib3
from io import BytesIO
from bs4 import BeautifulSoup
conn = urllib3.PoolManager()
docx = conn.request( 'GET', 'http://procon.rs.gov.br/upload/arquivos/201801/03151705-procon-sao-gabriel-ranking-de-2017.docx').data
document = ZipFile(BytesIO(docx)).read('word/document.xml').decode('utf-8')
print(document)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment