from selenium import webdriver


driver = webdriver.Chrome('D:\GitRoot\pros\Selenium\chromedriver\chromedriver_win32_104\chromedriver.exe')
driver.get("https://www.thsrc.com.tw/")
element = driver.find_element(By.CSS_SELECTOR, ".slick-current .pic-l")
actions = ActionChains(driver)
actions.move_to_element(element).perform()
element = driver.find_element(By.CSS_SELECTOR, "body")
actions = ActionChains(driver)
actions.move_to_element(element, 0, 0).perform()
driver.find_element(By.ID, "a_irs").click()
driver.switch_to.frame(1)
driver.find_element(By.ID, "select_location01").click()
dropdown = driver.find_element(By.ID, "select_location01")
dropdown.find_element(By.XPATH, "//option[. = '台北']").click()
driver.find_element(By.ID, "select_location02").click()
dropdown = driver.find_element(By.ID, "select_location02")
dropdown.find_element(By.XPATH, "//option[. = '台中']").click()
driver.find_element(By.ID, "Departdate02").click()
driver.find_element(By.CSS_SELECTOR, "tr:nth-child(6) > .day:nth-child(6)").click()
driver.find_element(By.ID, "toPortalTimeTable").click()
driver.find_element(By.CSS_SELECTOR, "td:nth-child(1) .fa-chevron-up").click()
driver.find_element(By.CSS_SELECTOR, "td:nth-child(1) .fa-chevron-up").click()
element = driver.find_element(By.CSS_SELECTOR, "td:nth-child(1) .fa-chevron-up")
actions = ActionChains(driver)
actions.double_click(element).perform()
driver.find_element(By.CSS_SELECTOR, "td:nth-child(1) .fa-chevron-up").click()
driver.find_element(By.CSS_SELECTOR, "td:nth-child(1) .fa-chevron-up").click()
driver.find_element(By.CSS_SELECTOR, "td:nth-child(1) .fa-chevron-up").click()
driver.find_element(By.CSS_SELECTOR, "td:nth-child(1) .fa-chevron-up").click()
driver.find_element(By.CSS_SELECTOR, ".col-lg-10").click()
driver.find_element(By.ID, "securityCode").click()
driver.find_element(By.ID, "securityCode").send_keys("VRC5")
vars["window_handles"] = driver.window_handles
driver.find_element(By.ID, "SubmitButton").click()
vars["win1111"] = wait_for_window(2000)
driver.switch_to.window(vars["win1111"])
driver.find_element(By.CSS_SELECTOR, "span:nth-child(7) .uk-radio").click()
driver.find_element(By.NAME, "SubmitButton").click()
driver.close()
25273c9840da609c4b415ab899aa92df24538bcc
<mask token>

<mask token>
driver.get('https://www.thsrc.com.tw/')
<mask token>
actions.move_to_element(element).perform()
<mask token>
actions.move_to_element(element, 0, 0).perform()
driver.find_element(By.ID, 'a_irs').click()
driver.switch_to.frame(1)
driver.find_element(By.ID, 'select_location01').click()
<mask token>
dropdown.find_element(By.XPATH, "//option[. = '台北']").click()
driver.find_element(By.ID, 'select_location02').click()
<mask token>
dropdown.find_element(By.XPATH, "//option[. = '台中']").click()
driver.find_element(By.ID, 'Departdate02').click()
driver.find_element(By.CSS_SELECTOR, 'tr:nth-child(6) > .day:nth-child(6)'
    ).click()
driver.find_element(By.ID, 'toPortalTimeTable').click()
driver.find_element(By.CSS_SELECTOR, 'td:nth-child(1) .fa-chevron-up').click()
driver.find_element(By.CSS_SELECTOR, 'td:nth-child(1) .fa-chevron-up').click()
<mask token>
actions.double_click(element).perform()
driver.find_element(By.CSS_SELECTOR, 'td:nth-child(1) .fa-chevron-up').click()
driver.find_element(By.CSS_SELECTOR, 'td:nth-child(1) .fa-chevron-up').click()
driver.find_element(By.CSS_SELECTOR, 'td:nth-child(1) .fa-chevron-up').click()
driver.find_element(By.CSS_SELECTOR, 'td:nth-child(1) .fa-chevron-up').click()
driver.find_element(By.CSS_SELECTOR, '.col-lg-10').click()
driver.find_element(By.ID, 'securityCode').click()
driver.find_element(By.ID, 'securityCode').send_keys('VRC5')
<mask token>
driver.find_element(By.ID, 'SubmitButton').click()
<mask token>
driver.switch_to.window(vars['win1111'])
driver.find_element(By.CSS_SELECTOR, 'span:nth-child(7) .uk-radio').click()
driver.find_element(By.NAME, 'SubmitButton').click()
driver.close()

<mask token>
driver = webdriver.Chrome(
    'D:\\GitRoot\\pros\\Selenium\\chromedriver\\chromedriver_win32_104\\chromedriver.exe'
    )
driver.get('https://www.thsrc.com.tw/')
element = driver.find_element(By.CSS_SELECTOR, '.slick-current .pic-l')
actions = ActionChains(driver)
actions.move_to_element(element).perform()
element = driver.find_element(By.CSS_SELECTOR, 'body')
actions = ActionChains(driver)
actions.move_to_element(element, 0, 0).perform()
driver.find_element(By.ID, 'a_irs').click()
driver.switch_to.frame(1)
driver.find_element(By.ID, 'select_location01').click()
dropdown = driver.find_element(By.ID, 'select_location01')
dropdown.find_element(By.XPATH, "//option[. = '台北']").click()
driver.find_element(By.ID, 'select_location02').click()
dropdown = driver.find_element(By.ID, 'select_location02')
dropdown.find_element(By.XPATH, "//option[. = '台中']").click()
driver.find_element(By.ID, 'Departdate02').click()
driver.find_element(By.CSS_SELECTOR, 'tr:nth-child(6) > .day:nth-child(6)'
    ).click()
driver.find_element(By.ID, 'toPortalTimeTable').click()
driver.find_element(By.CSS_SELECTOR, 'td:nth-child(1) .fa-chevron-up').click()
driver.find_element(By.CSS_SELECTOR, 'td:nth-child(1) .fa-chevron-up').click()
element = driver.find_element(By.CSS_SELECTOR, 'td:nth-child(1) .fa-chevron-up'
    )
actions = ActionChains(driver)
actions.double_click(element).perform()
driver.find_element(By.CSS_SELECTOR, 'td:nth-child(1) .fa-chevron-up').click()
driver.find_element(By.CSS_SELECTOR, 'td:nth-child(1) .fa-chevron-up').click()
driver.find_element(By.CSS_SELECTOR, 'td:nth-child(1) .fa-chevron-up').click()
driver.find_element(By.CSS_SELECTOR, 'td:nth-child(1) .fa-chevron-up').click()
driver.find_element(By.CSS_SELECTOR, '.col-lg-10').click()
driver.find_element(By.ID, 'securityCode').click()
driver.find_element(By.ID, 'securityCode').send_keys('VRC5')
vars['window_handles'] = driver.window_handles
driver.find_element(By.ID, 'SubmitButton').click()
vars['win1111'] = wait_for_window(2000)
driver.switch_to.window(vars['win1111'])
driver.find_element(By.CSS_SELECTOR, 'span:nth-child(7) .uk-radio').click()
driver.find_element(By.NAME, 'SubmitButton').click()
driver.close()

from selenium import webdriver
driver = webdriver.Chrome(
    'D:\\GitRoot\\pros\\Selenium\\chromedriver\\chromedriver_win32_104\\chromedriver.exe'
    )
driver.get('https://www.thsrc.com.tw/')
element = driver.find_element(By.CSS_SELECTOR, '.slick-current .pic-l')
actions = ActionChains(driver)
actions.move_to_element(element).perform()
element = driver.find_element(By.CSS_SELECTOR, 'body')
actions = ActionChains(driver)
actions.move_to_element(element, 0, 0).perform()
driver.find_element(By.ID, 'a_irs').click()
driver.switch_to.frame(1)
driver.find_element(By.ID, 'select_location01').click()
dropdown = driver.find_element(By.ID, 'select_location01')
dropdown.find_element(By.XPATH, "//option[. = '台北']").click()
driver.find_element(By.ID, 'select_location02').click()
dropdown = driver.find_element(By.ID, 'select_location02')
dropdown.find_element(By.XPATH, "//option[. = '台中']").click()
driver.find_element(By.ID, 'Departdate02').click()
driver.find_element(By.CSS_SELECTOR, 'tr:nth-child(6) > .day:nth-child(6)'
    ).click()
driver.find_element(By.ID, 'toPortalTimeTable').click()
driver.find_element(By.CSS_SELECTOR, 'td:nth-child(1) .fa-chevron-up').click()
driver.find_element(By.CSS_SELECTOR, 'td:nth-child(1) .fa-chevron-up').click()
element = driver.find_element(By.CSS_SELECTOR, 'td:nth-child(1) .fa-chevron-up'
    )
actions = ActionChains(driver)
actions.double_click(element).perform()
driver.find_element(By.CSS_SELECTOR, 'td:nth-child(1) .fa-chevron-up').click()
driver.find_element(By.CSS_SELECTOR, 'td:nth-child(1) .fa-chevron-up').click()
driver.find_element(By.CSS_SELECTOR, 'td:nth-child(1) .fa-chevron-up').click()
driver.find_element(By.CSS_SELECTOR, 'td:nth-child(1) .fa-chevron-up').click()
driver.find_element(By.CSS_SELECTOR, '.col-lg-10').click()
driver.find_element(By.ID, 'securityCode').click()
driver.find_element(By.ID, 'securityCode').send_keys('VRC5')
vars['window_handles'] = driver.window_handles
driver.find_element(By.ID, 'SubmitButton').click()
vars['win1111'] = wait_for_window(2000)
driver.switch_to.window(vars['win1111'])
driver.find_element(By.CSS_SELECTOR, 'span:nth-child(7) .uk-radio').click()
driver.find_element(By.NAME, 'SubmitButton').click()
driver.close()

from selenium import webdriver


driver = webdriver.Chrome('D:\GitRoot\pros\Selenium\chromedriver\chromedriver_win32_104\chromedriver.exe')
driver.get("https://www.thsrc.com.tw/")
element = driver.find_element(By.CSS_SELECTOR, ".slick-current .pic-l")
actions = ActionChains(driver)
actions.move_to_element(element).perform()
element = driver.find_element(By.CSS_SELECTOR, "body")
actions = ActionChains(driver)
actions.move_to_element(element, 0, 0).perform()
driver.find_element(By.ID, "a_irs").click()
driver.switch_to.frame(1)
driver.find_element(By.ID, "select_location01").click()
dropdown = driver.find_element(By.ID, "select_location01")
dropdown.find_element(By.XPATH, "//option[. = '台北']").click()
driver.find_element(By.ID, "select_location02").click()
dropdown = driver.find_element(By.ID, "select_location02")
dropdown.find_element(By.XPATH, "//option[. = '台中']").click()
driver.find_element(By.ID, "Departdate02").click()
driver.find_element(By.CSS_SELECTOR, "tr:nth-child(6) > .day:nth-child(6)").click()
driver.find_element(By.ID, "toPortalTimeTable").click()
driver.find_element(By.CSS_SELECTOR, "td:nth-child(1) .fa-chevron-up").click()
driver.find_element(By.CSS_SELECTOR, "td:nth-child(1) .fa-chevron-up").click()
element = driver.find_element(By.CSS_SELECTOR, "td:nth-child(1) .fa-chevron-up")
actions = ActionChains(driver)
actions.double_click(element).perform()
driver.find_element(By.CSS_SELECTOR, "td:nth-child(1) .fa-chevron-up").click()
driver.find_element(By.CSS_SELECTOR, "td:nth-child(1) .fa-chevron-up").click()
driver.find_element(By.CSS_SELECTOR, "td:nth-child(1) .fa-chevron-up").click()
driver.find_element(By.CSS_SELECTOR, "td:nth-child(1) .fa-chevron-up").click()
driver.find_element(By.CSS_SELECTOR, ".col-lg-10").click()
driver.find_element(By.ID, "securityCode").click()
driver.find_element(By.ID, "securityCode").send_keys("VRC5")
vars["window_handles"] = driver.window_handles
driver.find_element(By.ID, "SubmitButton").click()
vars["win1111"] = wait_for_window(2000)
driver.switch_to.window(vars["win1111"])
driver.find_element(By.CSS_SELECTOR, "span:nth-child(7) .uk-radio").click()
driver.find_element(By.NAME, "SubmitButton").click()
driver.close()