最近在学习网络爬虫,在做requests库练习时发现了一个错误。
import requests
url = "https://cn.bing.com/search?q=周杰伦"
resp = requests.get(url)
print(resp)
AttributeError: partially initialized module 'requests' has no attribute 'get' (most likely due to a circular import)
百思不得其解,最后发现文件命名有问题,将原来的requests.py改为其他名称即可。