使用Python Selenium进行下拉选择后无法加载网站
我有一个网站,其中包含需要删除的记录列表。我在登录页上有25个列表。我们在页面末尾有一个下拉列表,可以一次加载同一页面中的所有记录(1000条)(无url更改)。我正在使用Python selenium完成这项任务 附上我使用过的页面结构和代码示例使用Python Selenium进行下拉选择后无法加载网站,python,selenium-webdriver,automation,Python,Selenium Webdriver,Automation,我有一个网站,其中包含需要删除的记录列表。我在登录页上有25个列表。我们在页面末尾有一个下拉列表,可以一次加载同一页面中的所有记录(1000条)(无url更改)。我正在使用Python selenium完成这项任务 附上我使用过的页面结构和代码示例 <div class="d_length" id="q_length"> <label> <span class="result-mune&quo
<div class="d_length" id="q_length">
<label>
<span class="result-mune">
<span>Results </span>per page:
</span>
<select name="q_length" aria-controls="q_rankings" class="jcf-hidden">
<option value="25">25</option>
<option value="50">50</option>
<option value="100">100</option>
<option value="200">200</option>
<option value="-1">All</option>
</select>
<span class="j-select j-unselectable">
<span class="j-select-text">
<span class="">25</span>
</span>
<span class="j-select-opener"></span>
</span>
</label>
</div>
我可以加载网站,但选择没有按预期工作。它不是选择全部选项并加载页面
请看一看,并帮助我进行必要的更改
driver = webdriver.Chrome(executable_path=r"chromedriver.exe")
driver.get("link")
timeout = 10
element_present = EC.presence_of_element_located((By.CLASS_NAME, 'odd'))
WebDriverWait(driver, timeout).until(element_present)
select = Select(driver.find_element_by_xpath("//select[@name='q_length']"))
# select by visible text
select.select_by_visible_text('All')
element_present = EC.presence_of_element_located((By.CLASS_NAME, 'odd'))
WebDriverWait(driver, timeout).until(element_present)