0

I want to use a POST-Method with an Parameter in Request Body. After some research I found the library seleniumwire. I tried this:

from seleniumwire import webdriver

driver= webdriver.Firefox()

driver.header_overrides = {
'myfirstparamter': 'value'
}

driver.get('http://mywebsite.de')
driver.requests(method='POST', ??? thats the point where I dont know exactly how to keep going on.

Thanks!

Mobrine Hayde
  • 365
  • 1
  • 2
  • 10
marie1995
  • 59
  • 1
  • 3
  • 8

1 Answers1

0

First, you can use seleniumrequests it is much more easier (since seleniumwire is not only a requests library, but also has some other functions like binding, which will need other unwanted things to be implemented in your script). And why are you trying to send a get request then a post request, the later is enough to send parameters to host and get response.

Here is a simple script to post data using seleniumrequests library

from seleniumrequests import Firefox

driver = Firefox()
response = driver.request('POST', 'http://mywebsite.de', data={"parm1": "val1", "parm2": "val2"})
print(response)
Mobrine Hayde
  • 365
  • 1
  • 2
  • 10