import requests improt re headers = { 'User-Agent':'Mozilla/5.0(Windows NT 10.0;Win64; x64)AppleWebKit/537.36' } url='http://movie.douban.com/top250' response = requests.get(url,headers=headers) html = response.text