I am struggling to post to a javascript/react form with Pythons Requests. I understand the regular way would be something like this
payload = {"user": "me", "password": "12345"}
s = requests.Session()
html = s.post(url, data=payload) `
The url part is the problem, since I cannot find it in the source. The source of the form looks like this:
<form class="Login-form" method="POST" data-reactid="19"> … </form>
I assumed a value for the action parameter but, well, it ain't there. I also tried to find an url in the javascript but to be honest, I can't read it very well.
So my question would be: How – if at all – can I make a post with Requests to a react formular?
Edit:
To make the question more concise and reflect the accepted answer:
If an html-form with javascript has no obvious url in the source where it posts to, how can I find out the url?
action=argument POSTs to the current URL. But since you're dealing with React, it's probably handled by a action to an API endpoint behind the scenes. Watch the network tab under developer tools in your browser of choice to see how it's actually implemented.