import tls_client

session = tls_client.Session(client_identifier='chrome_117')
session.proxies = {
    'http': 'http://127.0.0.1:7890',
    'https': 'http://127.0.0.1:7890',
}
session.proxies = {
    'http': 'http://user-uni001-region-us-sessid-1111-sesstime-5-keep-true:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600',
    'https': 'http://user-uni001-region-us-sessid-1111-sesstime-5-keep-true:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600',
}
headers = {
    "authority": "booking.flyfrontier.com",
    "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
    "accept-language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7,ru;q=0.6",
    "cache-control": "no-cache",
    "pragma": "no-cache",
    "sec-ch-ua": "\"Google Chrome\";v=\"117\", \"Not;A=Brand\";v=\"8\", \"Chromium\";v=\"117\"",
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": "\"macOS\"",
    "sec-fetch-dest": "document",
    "sec-fetch-mode": "navigate",
    "sec-fetch-site": "same-origin",
    "sec-fetch-user": "?1",
    "upgrade-insecure-requests": "1",
    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36"
}

# headers['cookie'] =  '_gcl_au=1.1.722464866.1698810357; _ga_XXXX=GS1.1.1698810356.1.0.1698810356.0.0.0; _pxvid=2a55550f-7869-11ee-acf5-c9203fdba316; pxcts=2a55663a-7869-11ee-acf5-f6b8cb093cb9; _ga=GA1.2.1295470390.1698810357; _gid=GA1.2.1707451477.1698810360; _gat_UA-2678252-1=1; _uetsid=2c02f3e0786911ee83f54b37555df671; _uetvid=2c032890786911eeb98ad1d36ffcc3dc; wisepops=%7B%22csd%22%3A1%2C%22popups%22%3A%7B%7D%2C%22sub%22%3A0%2C%22ucrn%22%3A84%2C%22cid%22%3A%2278471%22%2C%22v%22%3A4%2C%22bandit%22%3A%7B%22recos%22%3A%7B%7D%7D%7D; wisepops_visits=%5B%222023-11-01T03%3A45%3A56.718Z%22%5D; wisepops_session=%7B%22arrivalOnSite%22%3A%222023-11-01T03%3A45%3A56.718Z%22%2C%22mtime%22%3A1698810360043%2C%22pageviews%22%3A1%2C%22popups%22%3A%7B%7D%2C%22bars%22%3A%7B%7D%2C%22sticky%22%3A%7B%7D%2C%22countdowns%22%3A%7B%7D%2C%22src%22%3Anull%2C%22utm%22%3A%7B%7D%2C%22testIp%22%3Anull%7D; _fbp=fb.1.1698810360050.1803367428; _px2=eyJ1IjoiYjhhMzk2NzAtNzg2Ni0xMWVlLTk2NTUtNjNhNGYwNWNkNWQxIiwidiI6IjJhNTU1NTBmLTc4NjktMTFlZS1hY2Y1LWM5MjAzZmRiYTMxNiIsInQiOjYyMDIzMzg4MDAwNywiaCI6ImM3ODFmMTVhMmVlZmUxYWMzZTBhNmQwYmQ4YzVhODA2NTFhNDhjOThmZTVmMmQ2MTIyMDc4YzUwYjYxYmU1YjIifQ==; _up=1.2.1818147287.1698810361; _tt_enable_cookie=1; _ttp=D3xep_DTwKRrOnkK63RwbIGqBC0; _ga_P2WLKWBNNW=GS1.1.1698810356.1.0.1698810363.53.0.0'


cks = {'__RequestVerificationToken': 'd5GB_r2bJa1WW7mdJur4_c7vjLsEDpzyhQtqPHWQRXnl_wXjLmSkTy8Bbeq3sVLSBg7eGZxHtNimZrnjqGy7E50NFTSQ2OXj7PVSnaTMd3H66D9KixZQ6ZZ6S1MQmnnYqPgnqA2', '_pxhd': '4b1493a648e9af2388fdab77efacede7baa4e5fabeeeb2a2c7c8cd3e5c21c3ac:b9c53127-7923-11ee-87f8-9a14ef5baa14', 'pxcts': 'be8f0fd4-7923-11ee-8062-2e3ce75f1058', '_pxvid': 'b9c53127-7923-11ee-87f8-9a14ef5baa14', '_px2': 'eyJ1IjoiYmQ5ZTc5YzAtNzkyMy0xMWVlLTg2OWEtMjdkMTdhNGUyNzMzIiwidiI6ImI5YzUzMTI3LTc5MjMtMTFlZS04N2Y4LTlhMTRlZjViYWExNCIsInQiOjYyMDIzMzg4MDAwNCwiaCI6IjRhMmEyNGY2ZTk5MDk4YzMyNDkyZjQ2MzZkN2YxZjEzNDcwN2EzZGVkMDJlNjEzZjliMzY4YjU2NTVhM2ZkOWIifQ=='}


# cookies.update(
# # {'_pxhd': '728b2d129b5a075513034298f8e2d4ce004425c1f307bd2baa8e9525fa6bb510:4290832e-77db-11ee-bdfb-76e73743688f', '_pxvid': '4290832e-77db-11ee-bdfb-76e73743688f', '_px2': 'eyJ1IjoiYjllMjlkNjEtNzA0MC0xMDMxLTk3ZjUtMjVlOTU0YzUxNGU5IiwidiI6IjQyOTA4MzJlLTc3ZGItMTFlZS1iZGZiLTc2ZTczNzQzNjg4ZiIsInQiOjE2OTg3NDk3MTE3OTksImgiOiIwZmZiOTUwNjRhODJiNzg4Yjg5YzQ1NDMzZThhMWQ5ZjQwNTY3NzcxNjU5MGY5Mjc0ZGNmYWIxY2MwN2RhMzZhIn0=', 'pxcts': '43453788-77db-11ee-a37b-78e6fe245189'}
#
# )

url = "https://booking.flyfrontier.com/Flight/InternalSelect"
params = {
    "s": "true",
    "o1": "DEN",
    "d1": "LAS",
    "dd1": "2023-12-01",
    "dd2": "0001-01-01",
    "mon": "true",
    "adt": "1"
}
response = session.get(url, headers=headers, cookies=cks, params=params, allow_redirects=True)

print(response.text)
print(response.url)
