Skip to content

Instantly share code, notes, and snippets.

@py3in
Last active December 4, 2015 14:02
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 py3in/55bb4392c0009c3c65db to your computer and use it in GitHub Desktop.
Save py3in/55bb4392c0009c3c65db to your computer and use it in GitHub Desktop.
frases_with_splinter
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import re
from time import sleep
url = "http://pensador.uol.com.br/frases_curtas/"
with Browser() as browser:
browser.visit(url)
browser.html
tree = html.fromstring(browser.html)
divs = browser.find_by_tag("div")
for div in divs:
print div.html.encode('utf8')
exit()
@py3in
Copy link
Author

py3in commented Dec 4, 2015

Error out-put
t

@py3in
Copy link
Author

py3in commented Dec 4, 2015

Solved with endode utf8

for div in divs:
    print div.html.encode('utf8')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment