我正在尝试使用Requests GET方法来获取此表单的结果:
FORM ENCTYPE='multipart/form-data' method=POST action="../cgi-bin/DktRpt.pl?515287285576685-L_1_0-1"
但输入值为:
INPUT TYPE='checkbox' NAME='list_of_parties_and_counsel' id='list_of_parties_and_counsel' value='on' CHECKED
如何告诉get方法包含'list_of_parties_and_counsel' = on
?我试过包括params = {'list_of_parties_and_counsel': 'on'}
,但这不起作用。
答案 0 :(得分:0)
所以你需要传递键/值对的字典或元组:
import requests
files = [("login","foo"),("key","pass"),("clcode","yourclcode"),("button1","Login")]
url = "https://ecf.nyed.uscourts.gov/cgi-bin/DktRpt.pl?382380"
with requests.Session() as s:
r = s.post(url, files=files)
这是登录页面的一个示例,您必须查看chrome并监视该特定表单帖子并执行相同的操作。