I'm trying to fill out a web form using python requests. Does anyone know the correct syntax when there is a drop down (option list)?
I can successfully post to the text boxes on the form, but not the option list
import requests
URL = 'http://127.0.0.1:8000/recoater/new/'
payload = {
'data': '40',
'machine': '"1">MachineA<',
}
r = requests.post(URL, data=payload)
print (r)
print(r.text)
Returns this:
<ul class="errorlist"><li>Select a valid choice. That choice is not one of
the available choices.</li></ul>
<p><label for="id_machine">Machine:</label> <select name="machine" required
id="id_machine">
<option value="">---------</option>
<option value="1">MachineA</option>