Skip to content

Instantly share code, notes, and snippets.

@sujinleeme
Last active September 25, 2016 07:10
Show Gist options
  • Save sujinleeme/c1132a3512b95db78d9922ce2ac44189 to your computer and use it in GitHub Desktop.
Save sujinleeme/c1132a3512b95db78d9922ce2ac44189 to your computer and use it in GitHub Desktop.
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