Есть несколько похожих вопросов, но я не нашел правильного решения.
Код: Выделить всё
for i in range(N):
try:
driver.find_element_by_xpath("//select[@id='search-type']/option[@value='%s']"%i).click()
driver.find_element_by_name("submit").click()
except:
print i
continue
elem = driver.find_element_by_id("my_id")
wait.until(lambda driver: driver.find_element_by_id('search-type').get_attribute("value")==str(i))
if no_results(get_bs_source(driver.page_source)):
print "No results %s"%i
if is_limited(get_bs_source(driver.page_source)):
print "LIMITED %s"%i
data+=get_links_from_current_page(driver)
Подробнее здесь: https://stackoverflow.com/questions/324 ... n-selenium
Мобильная версия