无法滚动到指定的值。在以下链接中
http://www.flipkart.com/mobiles/samsung~brand/pr?sid=tyy,4io&otracker=hp_nmenu_sub_electronics_0_Samsung
我需要点击排除出股票,因为我需要滚动网页并点击它。
通过自动化,我无法做到这一点
使用下面的代码获取坐标
Point hoverItem =driver.findElement(By.xpath("//li[@title='Exclude Out of Stock']/a")).getLocation();
嗨,我正在尝试用selenium登录到namecheap.com,但是无法选择登录表单。在选择元素时,我得到了这个错误:
selenium.common.exceptions.ElementNotVisibleException: Message: Element is not currently visible and so may not be interacted with
但是我可以看到,我选择了ok,xpath。这是我的密码:
from selenium import webdriver
from selenium.webdriver.support.ui import WebDri
目前,我正试图在整个网页中获取一些文本数据。一开始,我抓取所有的网页,然后慢慢地在网页中筛选,从每一页抓取我需要的数据。例如,由于动态ID的原因,我在抓取诸如平方英尺或邻居之类的项目时遇到了困难。我通过XPath或CSS选择器看到的许多例子都涉及到搜索文本,但在我试图抓取的每一页上都会发生变化。有什么办法能捕捉到这片土地或社区吗?
from bs4 import BeautifulSoup
from selenium import webdriver as wd
from selenium.common.exceptions import StaleElementReferenceExcep
我使用机器人框架和selenium库自动测试一个网站。
我需要点击菜单哪些元素在某个框架下,测试如下所示:
# switch to default content first
unselect frame
# switch to level one menu's frame which id is head and click menu1a which id is menu1a
select frame head
click menu1a
# switch to level two menu's frame which id is menuFrame and cli
我是selenium ide的新手,我想让一些网站自动化。我想要像这样。
点击
Click Link 1
do some clicking inside that link
go back to the list of link
Click Link 2
do some clicking inside that link
go back to the list of link
Click Link 3
and so on
我在这里唯一的问题是,我不知道它将如何从顶部点击第一个链接。这是网站的html。
<h5>20 seconds ago</h5>
<ul>
我使用selenium访问包含名册信息的所有div:
# this returns a <selenium.webdriver.firefox.webelement.FirefoxWebElement
divs = driver.find_elements_by_class_name('appointment-template')
元素中的这些div应该如下所示:
div class="appointment-template" id="appointment-3500508">
<p class="title"
我需要得到父类别,子类别和子类别。我得到的项目在主要类别,没有任何问题。在检索子类别中的元素时,我可以捕获Selenium元素,但是文本是空的。我该怎么办?
我的Python代码:
mainCategories = driver.find_element(By.ID, "mainMenu").find_elements(By.TAG_NAME, "li[class='categories']")
for i in mainCategories:
subCategories = i.find_elements(By.TAG_NAME,
关于Python 3.9和Selenium 4.00
嗨,我现在正在尝试在Chrome上自动下载一些东西。我得到了登录部分,并向下导航到页面,它工作正常。我有问题的下一部分是点击“导出”,然后“导出为csv”。我将鼠标悬停在HTML源代码上,它高亮显示了我需要按下的按钮,因此我点击了"copy XPath“,但selenium不会按下它,我得到了这个错误。
编辑:我不能共享网站,因为它被锁定在登录后,这不是我的登录给出;编辑结束。
Message: invalid selector: Unable to locate an element with the xpath expressi
嗨,大家好,我有一个任务要做一些从刮刮的工作,问题是我正在尝试通过点击进入页面的最终外观,那就是有一些数据的表,但有时它只需要一次点击,而在另一方面,它需要不止一次。在这种情况下,我尝试了使用if语句进行控制,在该语句中,我从页面的最终视图中输入了is_enabled()(I的if元素,也尝试了使用is_displayed()),转到打印出最终页面视图的函数。如果你能帮我因为我不知道该怎么解决了。这是我的密码
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from s
我正在尝试使用selenium webdriver选择一个下拉列表,但没有成功。当我运行该程序时,出现一个错误,显示
ERROR shown
No such element found, it should be SELECT BUT was a
HTML code
UL class="nav navbar-nav">
<li class="active">
<li class="dropdown open">
<a class="dropdown-toggle" data-toggle=&