#coding=utf-8
import requests
import re
from bs4 import BeautifulSoup
def get_tour_info():
url = 'http://www.cntour.cn'
html_txt = requests.get(url)
soup = BeautifulSoup(html_txt.text, 'lxml')
data = soup.select('#main>div>div.mtop.firstMod.clearfix>div.centerBox>ul.newsList>li>a')
for item in data:
result={
'title':item.get('title'),
'link':item.get('href'),
'ID':re.findall('\d+', item.get('href'))
}
print result
if __main__ == '__main__':
get_tour_info()