Last active
May 1, 2016 16:23
-
-
Save kakakaya/3b40a074a6dc7e8717154e85c0aa52e6 to your computer and use it in GitHub Desktop.
Google IME用顔文字辞書を http://kaomoji.n-at.me/kaomoji.html から生成
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 requests | |
soup = BeautifulSoup(requests.get("http://kaomoji.n-at.me/kaomoji.html").text, "html.parser") | |
kaomojis = filter(None, ['かおもじ\t'+i.getText()+'\t顔文字' if '\n' not in i.getText() else None for i in soup.find_all('span', class_='kaomoji')]) | |
with open('kaomoji_dic.txt', 'w') as f: | |
f.write('\n'.join(kaomojis)+'\n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment