python - accessing property in text response python 3
问题描述
I'm trying to access a response from a http request using python requests library. The response comes in a text format, json is not available
import requests
resp = requests.get('http://url.com')
print(resp.text)
=> login=http://new_url.com?anylock=9f8s9g0asd&calls=vlsdu2
I need the value after login=
so would it be a good approach to use resp.split('login=')[1]
解决方案
推荐阅读
- html - 如何在 Shiny 的服务器功能中包含指向本地文件的 HTML 下载链接?
- javascript - Asp.net core:下拉列表的调用控制器方法onchange
- reactjs - 使用 react-select 处理焦点
- javascript - 延迟加载和 ajax 调用问题
- list - 如何获取未知长度的 CMake 列表的最后一个元素?
- rust - 在 Substrate 框架中,如何从 Keypair 中获取私钥(secret key)?
- google-cloud-platform - GKE 上的 Kubernetes 入口在 https 上的 http / SSL_ERROR_SYSCALL 上导致 502 响应
- xamarin - 此 apk 导致未使用的代码和资源
- database - 将网站迁移到中文服务器后无法访问 wp-admin
- html - 如何允许鼠标单击靠近元素?