Home > other >  Simulation submission form post multiple parameters with the same problem
Simulation submission form post multiple parameters with the same problem

Time:09-25

 def post (the title, the rid_device_info_keyboard, writer, newstime downurl_qz, downpath, softsay, msmallpic, mbigpic, newstext, catid) : 
Query="HTTP://http://localhost/e/admin/jiekou.php? Pw=123456
"Data_form={
"Enews" : "AddNews,"
"Every" : catid, # column id
"Bclassid" : the column id # 0, father
"Id" : 0,
"Filepass" : int (time. Time ()), # post timestamp
"Username" : "admin",
"Oldfilename" : ", "
"Oldgroupid" : ", "
"Oldchecked" : 1,
"Newstext_url" : ", "
"Ecmsfrom" : "http://localhost/e/admin/ListNews.php? Every 3 ',
"FSTB" : ", "
"Oldttid" : ", "
"Ecmsnfrom" : 1,
"Ecmscheck" : 0,
"Havetmpic" : 0,
"Title" : the title,
"The rid_device_info_keyboard" : the rid_device_info_keyboard,
"Softwriter" : writer,
"Softtype" : ", "
"Downurl_qz" : downurl_qz,
"Downname []" : "download address 1,"
"Downpath [] :" downpath,
"Softsay" : softsay,

"Msmallpic []" : msmallpic,
"Mbigpic []" : mbigpic,
"Newstext" : newstext,
"Dokey" : 1,
"Autosize" : 5000,
"Infotags" : the rid_device_info_keyboard,
"Newstime" : newstime,
"Checked" : 1,
"Isgood" : 0,
"Firsttitle" : 0,
"Writer", "admin",
"Befrom" : ", "
"Dokey" : 1,
"Copyimg" : 1,
"Autosize" : 5000,
"Istop" : 0,
"Newstempid" : 0,
"Groupid" : 0,
"Userfen" : 0,
"Onclick" : 0,
"Totaldown" : 0,
"Addnews" : "pay",
}
Print (type (data_form))
Data=https://bbs.csdn.net/topics/urllib.parse.urlencode (data_form.) encode (encoding="utf-8")
The req=urllib. Request. The request (query, data=https://bbs.csdn.net/topics/data)
Res=urllib. Request. Urlopen (the req, timeout=10)
# result=res. The read (). The decode (' utf-8)
Print (" has been published successfully ")


The operation result is to print a success, but to see the actual value which the website backstage mbigpic only pass a [symbol, I passed mbigpic value is a list, containing more than value, hope to form submit multiple mbigpic [] form, with the same each form value corresponding to a passing mbigpic, don't know this kind of situation to pass multiple form values change with the same zha do? Head big

CodePudding user response:

Form is the key - value the value, the key, the value is a string, want to pass an array value, the value of an array is your code, such as json, string or a comma, into a value transmission,

Key - the value is not allowed to key repeat
  • Related