使用Python请求库从单个GET请求中获取头和内容

使用Python请求库从单个GET请求中获取头和内容,python,parsing,get,python-requests,Python,Parsing,Get,Python Requests,我正试图通过一个get请求同时获取标题和内容。 目前,我可以单独获得: Headers=requests.get('https://coinmarketcap.com', verify=False).headers 及 ParseLM=requests.get('https://coinmarketcap.com', verify=False).content 但是,当我试图解析来自同一请求的标题和内容时,这会发出两个单独的GET请求,尽管是分开的。调用requests.GET()一次,保存

我正试图通过一个get请求同时获取标题和内容。 目前,我可以单独获得:

Headers=requests.get('https://coinmarketcap.com', verify=False).headers

ParseLM=requests.get('https://coinmarketcap.com', verify=False).content
但是,当我试图解析来自同一请求的标题和内容时,这会发出两个单独的GET请求,尽管是分开的。

调用
requests.GET()
一次,保存整个结果:

response = requests.get('https://coinmarketcap.com', verify=False)
然后,您可以访问结果的各个部分:

headers = response.headers
content = response.content