Skip to content

Commit

Permalink
selenium 教学 09/08/2018
Browse files Browse the repository at this point in the history
  • Loading branch information
intypython committed Sep 8, 2018
1 parent 14c9d8c commit 78e81ba
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions seleniumDemo/selectTag.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from selenium import webdriver
from selenium.webdriver.support.select import Select

driver = webdriver.Chrome('/Users/inty/Downloads/chromedriver')
driver.fullscreen_window()
driver.get('https://www.timeanddate.com/')

selectElements = driver.find_element_by_id('month')

months = Select(selectElements)

months.select_by_visible_text('December')

countriesElemets = driver.find_element_by_id('country')

conutries = Select(countriesElemets)

conutries.select_by_visible_text('Taiwan')

driver.find_element_by_xpath("//form[@id='cf']//input[@value='View Calendar']").click()

0 comments on commit 78e81ba

Please sign in to comment.