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://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:11400",
    'https': "http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:11400",
}
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'] =  'pxcts=ff849a04-792d-11ee-bcad-8cefc646a1f8; _pxvid=ff848674-792d-11ee-bcad-d25daf72d7ac; _gcl_au=1.1.492994984.1698894923; _px2=eyJ1IjoiYjhhMzk2NzAtNzg2Ni0xMWVlLTk2NTUtNjNhNGYwNWNkNWQxIiwidiI6ImZmODQ4Njc0LTc5MmQtMTFlZS1iY2FkLWQyNWRhZjcyZDdhYyIsInQiOjYyMDIzMzg4MDAwNCwiaCI6IjhmOTlkNjIwMjlhMDcyODg1NGFkYmYwYjkyNjY4YTUwZDAyNjFlZDAxMWM1ZmQ2Yjk1NWZlZDYwN2RiZjJkMjkifQ==; _ga_XXXX=GS1.1.1698894932.1.0.1698894932.0.0.0; _gid=GA1.2.2071480983.1698894936; _gat_UA-2678252-1=1; _ga_P2WLKWBNNW=GS1.1.1698894941.1.0.1698894941.60.0.0; _ga=GA1.1.2050769517.1698894933; _fbp=fb.1.1698894957851.1104319316; _up=1.2.644169043.1698894966'


# cks = {'_pxhd': 'e86b755140adc330dfb93c876c10cd1f8fae7b82a2be21a84bf20bc9b1299fb5:f5fa5f9c-792b-11ee-b244-ee0930483fb3',
#        'pxcts': 'fd5e3664-792b-11ee-a735-8508d6242ead', '_pxvid': 'f5fa5f9c-792b-11ee-b244-ee0930483fb3',
#        '_px2': 'eyJ1IjoiZjY0NjZmZjAtNzkyYi0xMWVlLTkwMDQtNDNjZjg4Zjk3NGJjIiwidiI6ImY1ZmE1ZjljLTc5MmItMTFlZS1iMjQ0LWVlMDkzMDQ4M2ZiMyIsInQiOjYyMDIzMzg4MDAwNCwiaCI6ImYyZWJhZmE1NjFhNWY3MWFjYzYzYTcxODlmMDcyYzc0YTYwNzVhNTkwODkyYzBmZDY0N2JjODhjM2EyYTljZDYifQ=='}

# 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"
}
# , cookies=cks
response = session.get(url, headers=headers, params=params, allow_redirects=True)

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