url='http://www.baidu.com'
while True:
resp=requests.get(url).content.decode()
selector=etree.HTML(resp)
self.parse_data(selector)
next_url=''.join(selector.xpath("//div[@class='next']/text()"))
if next_url:
url=next_url
else:
break
work in while
猜你喜欢
转载自www.cnblogs.com/hankleo/p/12405611.html
今日推荐
周排行