Last active
September 25, 2016 07:10
-
-
Save sujinleeme/c1132a3512b95db78d9922ce2ac44189 to your computer and use it in GitHub Desktop.
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)])] | |
print(info) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment