Intellisense 不显示库的所有 class 定义
Intellisense not displaying all class definitions for libraries
我正在为这个项目使用 visual studio IDE(它有 python 3.x)。我尝试用 pip
安装 requests
和 lxml
(对于网络抓取工具),我设法安装它,导入它,并写下这一行:
__page = requests.get("www.google.com")
那我试试
__page.content()
但显然没有对此的定义。这不是唯一一个这样做的包。 lxml
、beautifulsoup
.
也会发生这种情况
有什么解决办法吗?
__page.text()
看起来不像一个函数,它看起来像一个属性,即__page.text
.
来自http://docs.python-requests.org/en/master/api/#requests.Response.text:
text
Content of the response, in unicode.
If Response.encoding is None, encoding will be guessed using chardet.
The encoding of the response content is determined based solely on HTTP headers, following RFC 2616 to the letter. If you can take advantage of non-HTTP knowledge to make a better guess at the encoding, you should set r.encoding appropriately before accessing this property.
我正在为这个项目使用 visual studio IDE(它有 python 3.x)。我尝试用 pip
安装 requests
和 lxml
(对于网络抓取工具),我设法安装它,导入它,并写下这一行:
__page = requests.get("www.google.com")
那我试试
__page.content()
但显然没有对此的定义。这不是唯一一个这样做的包。 lxml
、beautifulsoup
.
有什么解决办法吗?
__page.text()
看起来不像一个函数,它看起来像一个属性,即__page.text
.
来自http://docs.python-requests.org/en/master/api/#requests.Response.text:
text
Content of the response, in unicode.
If Response.encoding is None, encoding will be guessed using chardet.
The encoding of the response content is determined based solely on HTTP headers, following RFC 2616 to the letter. If you can take advantage of non-HTTP knowledge to make a better guess at the encoding, you should set r.encoding appropriately before accessing this property.