learn_python3_spider
learn_python3_spider copied to clipboard
没有想到原因,求解
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\bs4_init_.py", line 287, in init elif len(markup) <= 256 and ( TypeError: object of type 'NoneType' has no len()
也不放具体代码,神仙能给你定位问题。。。 我自己做的时候出现这个情况是因为爬的网站(豆瓣)做了简单反爬,需要给程序加一个headers 比如: headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36'} response = requests.get(url,headers = headers)