fname

from lxml import etree
import requests
def getHtml(html):
novelcontent = requests.get(html).content
return etree.HTML(novelcontent)

source = getHtml("http://www.cabintu.com")

urllist = source.xpath('//li[@class="airline"]/a')

for i in urllist:

url = i.attrib['href']
sources = getHtml(url)
fname = sources.xpath('//div[@class="maincontentairlines"]/h5/text()')

for g in fname:
print g

posted on 2016-11-28 19:39  chinxfin  阅读(244)  评论(0编辑  收藏  举报

导航