[text] H

Viewer

  1. import requests
  2.  
  3. # URL for login
  4. login_url = "http://www.waitroseconnect.co.uk/waitroseconnect/menu.nsf/Login?OpenAgent"
  5.  
  6. # Actual username and password
  7. username = "your_actual_username"
  8. password = "your_actual_password"
  9.  
  10. # Payload with username and password
  11. payload = {
  12.     "Username": username,
  13.     "Password": password
  14. }
  15.  
  16. # Send a POST request to authenticate
  17. session = requests.Session()
  18. response = session.post(login_url, data=payload)
  19.  
  20. # Check if authentication was successful
  21. if response.status_code == 200:
  22.     print("Authentication successful!")
  23.     # Now you can send further requests using the same session object
  24.     # For example, you can access another page after successful login
  25.     # response = session.get("http://www.waitroseconnect.co.uk/some_other_page")
  26.     # print(response.text)
  27. else:
  28.     print("Authentication failed. Status code:", response.status_code)

Editor

You can edit this paste and save as new:


File Description
  • H
  • Paste Code
  • 06 May-2024
  • 906 Bytes
You can Share it: