Skip to content

Instantly share code, notes, and snippets.

View uni8inu's full-sized avatar

uni8inu uni8inu

View GitHub Profile
@uni8inu
uni8inu / bs4_traverse.py
Last active December 27, 2016 11:02
BeautifulSoup4 TreeNode traverse and fix NavigableString
from bs4 import BeautifulSoup as bs
from bs4.element import Tag, NavigableString, Comment
# refer to / https://www.crummy.com/software/BeautifulSoup/bs4/doc/#navigablestring
ignore_list = ["", " ", "\n"]
def traverse(node):
if isinstance(node, Tag):
@uni8inu
uni8inu / narou_query.py
Created December 7, 2016 23:52
なろうディベロッパー Python3版サンプルコード
import json
from urllib.request import urlopen
import gzip
#sample get
#refer to: http://dev.syosetu.com/man/sample01/
#APIのURL(パラメーターを指定してください)
url = "http://api.syosetu.com/novelapi/api/?out=json&lim=100&gzip=5"
@uni8inu
uni8inu / gist.py
Last active December 7, 2016 23:50
test gist
print("hello world")
print("hello2") # fix!