我需要模拟html表单提交通过python form like this,但从卓越的文本
我尝试使用that link的代码,但它不起作用,它给出了错误(没有名为‘requests’的模块):
import requests
payload = {'AAAWebView-FormAAA-field1': field1Value, \
'AAAWebView-FormAAA-field2': field2Value, \
'NAV__BUTTON__press__AAAWebView-FormAAA-enter': "enter"
}
url="https://host/path1/path2/AdapterHTTP?action_name=myactionWebAction&NEW_SESSION=true"
headers = {'content-type': 'multipart/form-data'}
r = requests.post(url, data=payload, headers=headers, files={})
print r.status_code我对python完全陌生,有人能给我一个实用的例子吗?
我需要使卓越的文本插件,以推动代码从编辑器到jsfiddle
发布于 2014-04-28 00:41:09
您需要安装Requests library。例如:
pip install requestshttps://stackoverflow.com/questions/23325829
复制相似问题