def save(item):
with open('./Doubantop250.csv','a', encoding='utf-8') as file:
writer = csv.writer(file)
writer.writerow(item.values())
def run():
headers = {'User-Agent': "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36"}
for i in range(10):
url = 'https://movie.douban.com/top250?start={}&filter='.format(i*25)
html = parse_html(url, headers, {})
get_data(html)
print('Done!')
if __name__ == '__main__':
run()