MooreJohn90
MooreJohn90

Reputation: 164

Get form data from HTTP post

Normally, I need to fill in 'email' and 'password' to login a website. But I found out there is another field '-_-' when I am looking through the browser's developer tools. And the value of that field is always changing every time I login. Is there any way to get that value from Selenium or any others module.

Currently, I wrote the script by using Selenium. But I want to change to request module. In order to do that I need to know the value of that unknown field.

Upvotes: 0

Views: 139

Answers (1)

Eugene S
Eugene S

Reputation: 6910

You can try using the following css selector and then getting an attribute:

values = []
value = driver.find_elements_by_css_selector("input[type='hidden']:nth-child(1)")
print value.get_attribute('value')

Upvotes: 1

Related Questions