TypeError: 'str' object is not callable报错

这是我的代码:
import requests
url='https://www.so.com/s?ie=utf-8&src=360se7_addr_history&q=%E5%93%94%E5%93%A9%E5%93%94%E5%93%A9'
response=requests.get(url)
print(response)
报错:
Traceback (most recent call last):

File "C:\Users\QIJIAXIN.spyder-py3\untitled1.py", line 10, in
response=requests.get(url)

TypeError: 'str' object is not callable

img

跑的对的呀。你怎么跑的。

你的代码不只这4行吧,报错是File "C:\Users\QIJIAXIN.spyder-py3\untitled1.py", line 10, in,,这是第十行代码,而且你的代码我这边运行是没问题的

img

img

这些代码没问题

TypeError: 'str' object is not callable
报这个错,建议检查下你前面是不是用过str当做变量名,后面又调用了str()函数
如果不是,那么你可能函数或者字符串调用错误,比方说把response.text写成了response.text()