Skip to content

Instantly share code, notes, and snippets.

@kurozumi
Created March 25, 2016 04:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kurozumi/d31463c77c54c41e6c8e to your computer and use it in GitHub Desktop.
Save kurozumi/d31463c77c54c41e6c8e to your computer and use it in GitHub Desktop.
【Python】Seleniumを使ってセレクトボックスを操作する方法
# coding: utf-8
from selenium import webdriver
from selenium.webdriver.support.select import Select
driver.get("http://www.amazon.co.jp/s?node=4083271")
element = WebDriverWait(driver, 30).until(
EC.presence_of_element_located((By.CSS_SELECTOR, "select#sort"))
)
Select(element).select_by_value("date-desc-rank")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment