from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager

# options = webdriver.ChromeOptions()
# options.binary_location = r"C:\Program Files (x86)\Google\Chrome Dev\Application\chrome.exe"
# chrome_driver_binary = r"H:\Projects\Python\Automation\chromedriver.exe"
# browser = webdriver.Chrome(chrome_driver_binary, options=options)
browser = webdriver.Chrome()
browser.get('https://www.flynovoair.com/')
passenger = browser.find_element_by_css_selector('#searchForm > div:nth-child(2) > div:nth-child(3) > div:nth-child(1) > div > div > select > option:nth-child(2)')
passenger.click()
jashore = browser.find_element_by_css_selector('#searchForm > div:nth-child(2) > div.col-sm-6 > div:nth-child(2) > div:nth-child(2) > div > div > select > optgroup:nth-child(2) > option:nth-child(5)')
jashore.click()
date = browser.find_element_by_css_selector('#from-date')
date.clear()
date.send_keys('2019-04-28')
# date.submit()
search = browser.find_element_by_css_selector('#searchForm > div:nth-child(2) > div:nth-child(3) > div:nth-child(3) > div > input')
search.click()
rate = browser.find_element_by_css_selector('#trip_1_date_2019_04_28 > tbody:nth-child(3) > tr > td.family.family-PP.family-group-Y > label > input[type=radio]')
rate.click()
continue_to_next = browser.find_element_by_css_selector('#content > div > form.search_results > div:nth-child(4) > span > input[type=submit]')
continue_to_next.click()
checkbox = browser.find_element_by_css_selector('#agreed')
checkbox.click()
goto_next = browser.find_element_by_css_selector('#content > div > form > div.pnr_total > h3 > span.agreed > input[type=submit]')
goto_next.click()
mr = browser.find_element_by_css_selector('#passenger_entry > table.passenger.pax-type-ADT > tbody > tr:nth-child(1) > td:nth-child(1) > select > option:nth-child(2)')
mr.click()
f_name = browser.find_element_by_css_selector('#passenger_entry > table.passenger.pax-type-ADT > tbody > tr:nth-child(1) > td:nth-child(2) > input')
f_name.send_keys('Remon')
l_name = browser.find_element_by_css_selector('#passenger_entry > table.passenger.pax-type-ADT > tbody > tr:nth-child(1) > td:nth-child(3) > input')
l_name.send_keys('Rakibul')
day = browser.find_element_by_xpath('//*[@id="PX[0].dateOfBirth.day"]/option[2]')
day.click()
month = browser.find_element_by_xpath('//*[@id="PX[0].dateOfBirth.month"]/option[12]')
month.click()
year = browser.find_element_by_xpath('//*[@id="PX[0].dateOfBirth.year"]/option[25]')
year.click()
m_phone = browser.find_element_by_xpath('//*[@id="PX[0].PH[0].countryCode"]/optgroup[1]/option[1]')
m_phone.click()
number = browser.find_element_by_css_selector('#passenger_entry > table.contact_info > tbody > tr:nth-child(1) > td:nth-child(3) > input')
number.send_keys('1711309969')
email = browser.find_element_by_css_selector('#passenger_entry > table.contact_info > tbody > tr:nth-child(3) > td:nth-child(2) > input')
email.send_keys('remon.rakibul.star@gmail.com')