这个为什么AttributeError: module 'urllib.request' has no attribute 'get',求帮助解决,怎么改

这个为什么AttributeError: module 'urllib.request' has no attribute 'get',求大佬帮忙,怎么改

img

这篇文章:第二章 urllib数据挖掘(爬虫有道翻译及关于AttributeError: module 'urllib.request' has no attribute 'parse'的问题) 也许能够解决你的问题,你可以看下
你还可以看下python参考手册中的 python-urllib.error --- urllib.request 引发的异常类

意思是request包中没有get函数,是不是用urlopen啊

你是导入的urllib库的urllib.request,用法是urllib.request.urlopen(url)

https://blog.csdn.net/qq_43546676/article/details/88777227

request.get(url, headers=headers) 改为 request.urlopen(url, headers=headers)