I try to build a python script who sends a POST with parameters for extracting the result, but I don't know where is my problem o why I can get de page result to see the html that I need...
import requests
url = ('https://ar.ec.universal-assistance.com/cotizar-asistencia-al-viajero')
data = { '__RequestVerificationToken':'QWsTn0wqFmW9_jFfaBuuOjaWM4TE2Xk1XGn-oDTp0TENBO725YSkGnK8WeiAN53-jiPnjTDJ6zbZQjb6SzpprdCT4OlJg9jjZJKx1Wh7fGkZ5yCLkArUWCp6AIwq0t12gsonhP3orHzFJ2_1YqvIfJMcnzn2aXCb1-ZrDOzHM701', 'CCTLD':'.ar', 'CodigoOrganizacion':"", 'CodigoConvenio':"", 'OcultarTipoViaje':'false', 'CantidadPasajeros':1, 'CantidadDias':3, 'Origen':'ARGENTINA', 'Destino':'Centro america/Caribe', 'TipoViaje':'Un viaje', 'FechaInicio':'20/06/2019', 'FechaFin':'22/06/2019', 'Edad1':27, 'Edad2':"", 'Edad3':"", 'Edad4':"", 'Edad5':"", 'Edad6':"", 'Edad7':"", 'Edad8':"", 'Edad9':"", 'Edad10':"", 'Email':'no@no.com', 'Nombre':'PEDRO', 'Apellido':'PEREZ', 'CodigoArea':800, 'NumeroTelefono':9997777, 'dr':"", 'cn':'(direct)', 'cs':'(direct)', 'cm':'(none)', 'ck':'(not set 5)', 'cc':'(not set 5)', 'ua':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36', 'ref':'ar.ec.universal-assistance.com', 'sr':'1366x768', 'vp':'1366x728' } resp = requests.post(url = url, data = data )
print(resp.text)
And I tryed to do...
import requests
url = ('https://ar.ec.universal-assistance.com/cotizar-asistencia-al-viajero')
header = { ":authority": "ar.ec.universal-assistance.com", ":method": "POST", ":path": "/cotizar-asistencia-al-viajero", ":scheme": "https", "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3", "accept-encoding": "gzip, deflate, br", "accept-language": "es-ES,es;q=0.9", "cache-control": "max-age=0", "content-length": "921", "content-type": "application/x-www-form-urlencoded", "cookie":"__cfduid=db577552fb94c6b34d51ff081f56060601559763003; _ga=GA1.2.1051767382.1559763017; _fbp=fb.1.1559763016835.1821187230; ASP.NET_SessionId=zirpp0zdbsvt4p102zvfknic; __RequestVerificationToken=RuGNfaFUJxBI4FDOaVsMJBdBNwbqzUt_AMjdUu6Am3T6kpBrZ5__wM8CiDO3Ttw6z6iBseVrGvzsyD-GCoWI2XRuhHpJB3-qu7qXvjoDu3NQL6onXupDL1E4ZkUXuHpDSPi0mjQ7F5PSFf2l_SGtDA2; _gid=GA1.2.1308535569.1560799988; _gat=1", "origin": "https://ar.ec.universal-assistance.com", "referer": "https://ar.ec.universal-assistance.com/cotizar-asistencia-al-viajero", "upgrade-insecure-requests": 1, "user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"
},
data = { '__RequestVerificationToken':'QWsTn0wqFmW9_jFfaBuuOjaWM4TE2Xk1XGn-oDTp0TENBO725YSkGnK8WeiAN53-jiPnjTDJ6zbZQjb6SzpprdCT4OlJg9jjZJKx1Wh7fGkZ5yCLkArUWCp6AIwq0t12gsonhP3orHzFJ2_1YqvIfJMcnzn2aXCb1-ZrDOzHM701', 'CCTLD':'.ar', 'CodigoOrganizacion':"", 'CodigoConvenio':"", 'OcultarTipoViaje':'false', 'CantidadPasajeros':1, 'CantidadDias':3, 'Origen':'ARGENTINA', 'Destino':'Centro america/Caribe', 'TipoViaje':'Un viaje', 'FechaInicio':'20/06/2019', 'FechaFin':'22/06/2019', 'Edad1':27, 'Edad2':"", 'Edad3':"", 'Edad4':"", 'Edad5':"", 'Edad6':"", 'Edad7':"", 'Edad8':"", 'Edad9':"", 'Edad10':"", 'Email':'no@no.com', 'Nombre':'PEDRO', 'Apellido':'PEREZ', 'CodigoArea':800, 'NumeroTelefono':9997777, 'dr':"", 'cn':'(direct)', 'cs':'(direct)', 'cm':'(none)', 'ck':'(not set 5)', 'cc':'(not set 5)', 'ua':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36', 'ref':'ar.ec.universal-assistance.com', 'sr':'1366x768', 'vp':'1366x728' } resp = requests.post(url = url, data = data )
print(resp.text)
theme use BeautifulSoup
I expect the html of "https://ar.ec.universal-assistance.com/ofertas-asistencia-al-viajero"
That would be the next page from fist url.
Aucun commentaire:
Enregistrer un commentaire