Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # import urllib2
- # import urllib
- from bs4 import BeautifulSoup
- from binascii import a2b_base64
- gmail = 11
- softbank = 12
- docomo = 13
- kddi = 14
- font = docomo
- ext = '.png'
- # url = 'http://unicode.org/emoji/charts/full-emoji-list.html'
- contents = open('emojitable.html','r').read()
- soup = BeautifulSoup(contents)
- tbody = soup.find("tbody")
- for row in tbody.findAll('tr'):
- #first_column = row.findAll('th')[0].contents
- uni = ""
- sb = ""
- columns = row.findAll('td')
- if len(columns) > 0:
- uni = columns[1].a.contents[0].replace('U+','').replace(' ','_')
- sbc = columns[font]
- if sbc.contents is not '\u2014':
- if sbc.img is not None:
- sb = sbc.img['src']
- if sb is not None:
- binary_data = a2b_base64(sb.replace('data:image/png;base64,',''))
- fd = open('rip/'+uni+ext, 'wb')
- fd.write(binary_data)
- fd.close()
- #print uni, sb
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement