0

I have a webpage with a multi-step form that I would like to fill.

The different steps in the form are not separated by different URLs, so the only way to get to the second step of the form is by clicking submit on the first step of the form (the second step of the form depends on the information filled in the first step, so the server generates the webpage after you click submit).

I am aware of how to do this using Python's Mechanize library, however, the server I am working on does not have this library (and I have no authority to install it).

Is there a way to do this using Python's request or urllib library, which come pre-installed?

E.g. something like:

import requests
response = requests.request("POST", URL, headers=headers, data=payload)
response2 = response.request("POST", URL, headers=new_headers, data=new_payload)
G.Lang
  • 121
  • 1
  • 3
  • Did you try sending multiple http requests using `requests.Session()` to the url link of 'submit' after filling out desired fields? – Ishwar Venugopal Feb 03 '21 at 10:02
  • Refer to this as it may have some directions to solve your problem: https://stackoverflow.com/questions/12737740/python-requests-and-persistent-sessions – Ishwar Venugopal Feb 03 '21 at 10:05

0 Answers0