我正在使用具有NTLM身份验证支持的Python Requests
库
import requests
from requests_ntlm import HttpNtlmAuth
url = 'http://ManufacturingRequests/AllItems.aspx'
username = 'domain\user'
password = 'pass'
r = requests.get(url,auth=HttpNtlmAuth(username,password))
print r.text.encode('utf-8')
我正在使用的网址的HTML看起来像
<input type="button"
name="Button"
value="OK"
onclick="if (!PreSaveItem()) return false;WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("Button;, "", true, "", "", false, true))"
id="ctl00_PlaceHolderMain_g_6b9c5d27_394f_4ab7_9c54_1b7507fd14a1_savebutton1_ctl00_diidIOS veItem"
accesskey="O"
class="ms-ButtonHeightWidth"
target="_self"
>
如何点击按钮(提交按钮表格)?
toPost = {'Button': 'submitForm'}
r = requests.post(url, data=toPost)