After studying Python, I tried to get a thread list of breaking news (dislike).
get_kenmo.py
# -*- coding: utf-8 -*-
import urllib
def get_kenmo():
response = urllib.urlopen('http://engawa.2ch.net/poverty/subject.txt')
html = unicode(response.read(), "cp932", 'ignore').encode("utf-8")
for line in html.split("\n"):
if line != "":
print(line.split("<>", 2)[1])
if __name__ == "__main__":
get_kenmo()
Recommended Posts