|

楼主 |
发表于 2021-2-25 15:02:59
|
显示全部楼层
它出错了 - ============== RESTART: C:\Users\86177\Desktop\python学习\豆瓣250爬虫.py =============
- Traceback (most recent call last):
- File "C:\Users\86177\Desktop\python学习\豆瓣250爬虫.py", line 6, in <module>
- soup = b.BeautifulSoup(res.text, 'html.parser',headers=headers)
- File "C:\Users\86177\AppData\Local\Programs\Python\Python39-32\lib\site-packages\bs4\__init__.py", line 252, in __init__
- builder = builder_class(**kwargs)
- File "C:\Users\86177\AppData\Local\Programs\Python\Python39-32\lib\site-packages\bs4\builder\_htmlparser.py", line 325, in __init__
- super(HTMLParserTreeBuilder, self).__init__(**kwargs)
- TypeError: __init__() got an unexpected keyword argument 'headers'
- >>>
复制代码 |
|