检查一下,这是我做的,然后才知道选择模块做了什么
from selenium import webdriverbrowser = webdriver.Firefox()#pre to get you to the pageselect_box = browser.find_element_by_name("countries") # if your select_box has a name.. why use xpath?..... # this step could use either xpath or name, but name is sooo much easier.options = [x for x in select_box.find_elements_by_tag_name("option")]# this part is cool, because it searches the elements contained inside of select_box # and then adds them to the list options if they have the tag name "options"for element in options: print element.get_attribute("value") # or append to list or whatever you want here这样的输出
-1459100300



