Python 3.x 使用请求发布textarea数据
我正在学习使用请求,但在从表单的Textarea字段发布和检索数据时遇到了问题Python 3.x 使用请求发布textarea数据,python-3.x,python-requests,Python 3.x,Python Requests,我正在学习使用请求,但在从表单的Textarea字段发布和检索数据时遇到了问题 import requests url = 'https://northcutt.com/tools/free-seo-tools/multiple-reverse-ip-lookup/' values = {'f_ip_list' : '134.177.0.178'} headers = {} headers['User-Agent'] = "Mozilla/5.0 (X11; Linux i686) Apple
import requests
url = 'https://northcutt.com/tools/free-seo-tools/multiple-reverse-ip-lookup/'
values = {'f_ip_list' : '134.177.0.178'}
headers = {}
headers['User-Agent'] = "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.27 Safari/537.17"
r = requests.post(url, data=values, headers = headers)
print(r.text)
正如我在Chrome中检查的那样,这个表单有两个数据源:f_ip_list和dataSource。我两个都试过了,但还是没有结果。我将感谢任何帮助
代码中使用的IP是随机生成的。您只传递formdata中的一个字段
URL=”https://northcutt.com/tools/free-seo-tools/multiple-reverse-ip-lookup/"
值={
“f_ip_列表”:“0.0.0.0”,
“数据源”:“免费搜索引擎优化工具”
}
response=requests.post(url=url,data=value)
输出:
哦,它就在我鼻子前面。非常感谢。