简体   繁体   English

python提交html表单(崇高的文本插件)

[英]python submit html form (sublime text plugin)

I need to simulate html form submit via python form like this but from sublime text 我需要模拟这样的通过python表单提交的html表单,但要通过崇高的文本

I try code from that link but it doesn't work for me it give error (No module named 'requests'): 我尝试从该链接获取代码但对我不起作用,它给出错误消息(没有名为“ 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

I'm absolutely new in python can someone give me a working example 我是python的新手,有人可以给我一个有效的例子

I need to make sublime text plugin to push code from editor to jsfiddle 我需要制作崇高的文本插件以将代码从编辑器推送到jsfiddle

You need to install the Requests library . 您需要安装Requests库 For example: 例如:

pip install requests

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM