import urllib
from urllib import request
from bs4 import BeautifulSoup
def download(url):
headers = {"User-Agent": "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0);"}
request = urllib.request.Request(url, headers=headers)
data = urllib.request.urlopen(request).read()
soup = BeautifulSoup(data, "html5lib")
data = soup.find_all("table", class_="tablelist")
for line in data[0].find_all("tr", class_=["even", "odd"]):
print(line.find_all("td")[0].a["href"])
for data in line.find_all("td"):
print(data.string)
download("http://hr.tencent.com/position.php?keywords=python&lid=0&tid=0&start=100#a")