Created
April 10, 2017 16:01
-
-
Save bhaavanmerchant/3ab9e5114f3b0340139a9a4079ce21ba to your computer and use it in GitHub Desktop.
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 bs4 import BeautifulSoup | |
import urllib2 | |
soup = BeautifulSoup(html_doc, 'http://m.xkcd.com') | |
try: | |
img = urllib2.urlopen(soup.find_all(id='comic')[1].get_src()).read() | |
# do facebook stuff here | |
except: | |
pass | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment