我使用的是Python请求模块,对于API执行,响应是文本/html格式的。我需要从回复中提取一个特定的文本。你知道吗
{'Cache-Control': 'must-revalidate', 'Content-Type': 'text/html; charset=UTF-8', 'Date': 'Thu, 16 May 2019 01:57:47 GMT', 'Expires': 'Sat, 26 Jul 1997 05:00:00 GMT', 'Pragma': 'no-cache', 'Server': 'Apache', 'Set-Cookie': 'targetValue-fox=a%3X4%3F%7vu%4t0%3Bs%3A32%3A%34242342jkjk2342342kj42%22%3G%9K; expires=Thu, 16-May-2019 03:57:47 GMT;'Connection': 'keep-alive'}
我需要提取Set-Cookie
的值。请告诉我怎么做。你知道吗
从字典的内容来看,它们实际上看起来像头,如果它们是,则使用
req.headers
将它们放入字典中然后可以从
resp
字典中提取键Set-Cookie
的值相关问题 更多 >
编程相关推荐