我正试图用请求库处理一些网络抓取的东西,但我无意中发现了加密的POST数据。我想做的是通过编程找到一种方法来检索POST变量的键名,这样我就可以发送自己未过滤的值了。有没有办法做到这一点,有人能给我解释一下,或者给我指出正确的方向吗?在
import requests
s = requests.Session('http://thiswebsite.com/login', auth=('username','password'))
# Find some way to determine what k is for POST variables in k,v
params = {
'INeedThis' : 'So I can pass this',
'AndAlsoThis' : 'So I can pass this too',
'AndSoOn' : 'etc'
}
x = post('http://thiswebsite.com/anotherpage', params)
print x.status_code
如果您需要}
POST
发送的数据的名称,那么您必须首先GET
这个页面并找到<input>
,<button>
,<text>
中的{例如-登录页面脸谱网在
结果:
^{pr2}$如您所见,有许多
input
,因此有时最好手动使用browser
,并查看从浏览器到服务器的“名称”是什么:)相关问题 更多 >
编程相关推荐