gpt4 book ai didi

python - 为什么我在尝试网页抓取时不断遇到 "Type Error"问题?

转载 作者:太空宇宙 更新时间:2023-11-03 20:35:00 25 4
gpt4 key购买 nike

当我运行时,为什么我总是收到“TypeError: init() gets an Unexpected keywords argument 'strict'”

res = requests.get('https://automatetheboringstuff.com/files/rj.txt')

Traceback (most recent call last):

File "<stdin>", line 1, in <module
>
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\api.py", line 49, in get

return request('get', url, **kwargs)

File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\api.py", line 38, in request

return session.request(method=method, url=url, **kwargs)

File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 232, in _get_conn

return conn or self._new_conn()

File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 199, in _new_conn
strict=self.strict)

TypeError: __init__() got an unexpected keyword argument 'strict'

最佳答案

解决方案是使用最新版本的requests:)

关于python - 为什么我在尝试网页抓取时不断遇到 "Type Error"问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57224385/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com