import requests
from lxml import etree
s = requests.Session()
for id in range(0,251,25):
url ='https://movie.douban.com/top250/?start-'+str(id)
r = s.get(url)
r.encoding = 'utf-8'
root = etree.HTML(r.content)
items = root.xpath(' ')
#print(len(items))
for item in items:
title = item.xpath(' ') #/text加在最后就是找它的文本内容
print(title)