0
I am trying to make a web scraping in python. My code is as follows:
import requests
from bs4 import Beautifulsoup
Session = requests. Session()
payload = {'username':'[xxxxx]',
'password':'[xxxxx]'
}
url = 'http://portalservicos.jucec.ce.gov.br/auth/realms/Portal_Interno/login-actions/authenticate?code='
'Nmid0kphhhbiuuefrayvtqihfq8pgnhoun0tr8rtp0m.97621447-8553-43f8-B505-bee4d488dc16&Execution=e489f6d8-a24c-'
'400b-A121-b4dd05035c47'
s = Session.post(url,data=payload,headers = Dict(referer=url))
The answer is 200, but the page obtained is the same as before login.
Include that line:
page=Session.get('http://portalservicos.jucec.ce.gov.br/srm/principal.jsf') Soup = Beautifulsoup(page.text, 'html.parser')
It also did not work, it is as if the login had not been done, The content of the page is the same as before the login.
Can someone help me?
The parameters
code
andexecution
are dynamic. First scratch the login page, take the form action and submit the login for that action in itsession
. This may not be the solution, but it’s where you should start.– Guilherme Brügger