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
import requests | |
from bs4 import BeautifulSoup | |
read=requests.get('http://www.roadrun.co.kr/schedule/view.php?no=6198') | |
read.encoding = 'euc-kr' | |
soup = BeautifulSoup(read.content, 'html.parser') | |
table = soup.find_all('table')[1]) | |
info = [s.strip() for s in table.text.splitlines() if s] | |
info = list(filter(None, info))[1::2] | |
info[11:len(info)] = [' '.join(info[11:len(info)])] |
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
# beautiful Soup 한국어 인코딩 문제 | |
# -*- coding: utf-8 -*- | |
import sys | |
import urllib.request | |
import re | |
from bs4 import BeautifulSoup | |
content = urllib.request.urlopen("http://www.roadrun.co.kr/schedule/view.php?no=6198") | |
soup = BeautifulSoup(content.read().decode('euc-kr', 'ignore'), 'html.parser') | |
print(soup) |
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
# beautiful Soup 한국어 인코딩 문제 | |
# -*- coding: utf-8 -*- | |
import sys | |
import urllib.request | |
import re | |
from bs4 import BeautifulSoup | |
content = urllib.request.urlopen("http://www.roadrun.co.kr/schedule/view.php?no=6198") | |
soup = BeautifulSoup(content.read().decode('euc-kr', 'ignore'), 'html.parser') | |
print(soup) |
NewerOlder