Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 97778

login with requests library python

$
0
0

i'm trying to click a log in button with requests library, is the first time that i use this library. my code is:

import requests


def login(credentials):
    response = requests.post("https://www.kickz.com/en/checkout/login_offer", data=credentials)

if response.ok:
    print('success')
else:
    raise Exeption ('error', response.status_code)

if __name__ == '__main__':
    credentials = {"E-Mail Address" : "help@me.com", "Password" : "please"}
    login(credentials)`

the code print 'success' but i have no idea how to click the log in button the html code of the button is:

<button type="submit" class="btn btn-block btn-green btn-lg"><span>Log in</span></button>
<span>Log in</span>
</button>

i've done it with Selenium, but i would like to know if it's possibile done it with requests

thank you for dedicating your time to help me.


Viewing all articles
Browse latest Browse all 97778

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>