Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Requests problem
#1
Hi,
I'm trying to connect to a website with requests library.
This is my code :

import requests

url = 'http://www.website.com'

values = {
    'loginForm': 'loginForm',
    'loginForm:login': '',
    'loginForm:password': '',
    'loginForm:submit': 'Valider',
    'javax.faces.ViewState': 'j_id2'
}

with requests.Session() as s:
    response = s.post(url, data=values)
    print(response.text)
When i'm executing this one, it will redirect me at the same page, login form. I don't know why.
Did I forgot something ?

Here are informations I sent when I submit form.

[Image: 180522100614516744.png]

Thanks for your help Sad
Reply


Messages In This Thread
Requests problem - by ZarKx - May-22-2018, 07:58 AM
RE: Requests problem - by snippsat - May-22-2018, 11:12 AM
RE: Requests problem - by ZarKx - May-22-2018, 12:22 PM
RE: Requests problem - by DeaD_EyE - May-22-2018, 12:17 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Import requests/beautifulsoup problem Jokadaro_ 3 2,158 Dec-05-2021, 01:22 PM
Last Post: Jokadaro_
  Problem in DB requests using if()s nikos 4 2,773 Feb-09-2019, 11:52 PM
Last Post: nikos

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020