【发布时间】:2015-12-25 11:33:36
【问题描述】:
我正在访问这个page,我必须选择一个显示现有简历的组合值。我收到错误:
selenium.common.exceptions.ElementNotVisibleException:消息: 元素当前不可见,因此可能无法与之交互
我正在尝试的代码是:
from selenium import webdriver
from selenium.webdriver.support.select import Select
from time import sleep
from bs4 import BeautifulSoup
driver = webdriver.Firefox()
driver.get('https://www.glassdoor.com/job-listing/developer-one-north-interactive-JV_IC1128808_KO0,9_KE10,31.htm?jl=1584069572')
select_box = driver.find_element_by_id('ExistingResume')
select_box.click();
select_box = Select(select_box)
sleep(5)
select_box.select_by_value(RESUME_TEXT_VALUE)
更新需要的元素就在那里
更新 #2:检查该元素在静态 html 中不可见。通过正在加载的 JS 进行猜测。
更新#3:好的,我做了以下更改,打印标签名称为select:
select_box = driver.find_element_by_id('ExistingResume')
print(select_box.tag_name)
现在的任务是从该组合中选择值
【问题讨论】:
-
因为没有名为
ExistingResume的元素...我只能找到一个名为ExistingResumeCount的元素。 -
@KevinGuan 检查更新#3