我正在查看该场景的输入,其中server1在新窗口中从另一台服务器打开表单中的填充数据,而无需使用activeX和serverside脚本。
我们怎么做? 感谢
答案 0 :(得分:0)
我不太确定我完全理解这个问题,但您可以使用python的urllib或urllib2模块发布到网站:
import urllib
import urllib2
opener = urllib2.build_opener(MultipartPostHandler)
opts = {
'field_name' = value,
'another_field_name' = another_value,
}
headers = {
'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.0; en-GB; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12',
'Accept': 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5',
'Accept-Language': 'en-gb,en;q=0.5',
'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
'Connection': 'keep-alive'
}
req = urllib2.Request(url, opts, headers)
response = opener.open(req)
#something along these lines should work well for POSTing to a website
您可以在此处查看urllib和urllib2的文档:
http://docs.python.org/library/urllib.html
http://docs.python.org/library/urllib2.html