我试图让Selenium点击View All Companies按钮,但我不知道我做错了什么。它返回no element found
html代码
<div class="screener-toggles">
<div class="buttons">
<span class="button selected" data-name="advanced-screener">Search by Screener<span data-name="advanced-screen
我正在尝试创建一个机器人,在BestBuy上为我的购物车添加一台4k电视,作为自学硒的一种方式。在将我的“元素”变量与BestBuy的网站上的按钮相关联时,我遇到了问题。我一直在浏览一些论坛,但找不到有效的解决方案。我通过的HTML找到了这个元素。
下面是我认为是在铬中找到元素的图片:
下面是我的python代码(请原谅我今天刚开始学习Selenium的代码太草率了):
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
PATH = "C:\Progra
我正试着在Selenium中做一些网络浏览。但是,当我运行代码时,它不会显示结果。
这是我的代码:
import selenium
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from bs4 import BeautifulSoup
import time
import pandas as pd
driver = webdriver.Chrome()
url = 'https:/
我是新来的,并试图使这个过程自动化。每次我运行代码时,我都会得到一个错误:
WebDriverException: 'css selector' is not valid or implemented searching strategy.
以下是我的代码:-
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
# starting the file
os.startfile(r'C:\Users\RT
我正在使用python中的selenium从google搜索中抓取所有相关的URLS。
我知道,如果我想在同一个类中有一个URL列表,我可以执行以下操作:
div = driver.find_element_by_class_name('r')
name = div.find_elements_by_css_selector('a')
我真正想要的是在谷歌页面上的每一个类'r‘的href的网址。我试过这个:
div = driver.find_elements_by_class_name('r')
name = div.find_elem
我有个问题。我想在这里点击使用Selenium的Zadanie 1:
我尝试过xpath、部分链接、链接文本等等,但是一直都有错误。
Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/div/div/div/div[2]/div[1]/a/h2"}
Message: no such element: Unable to locate element: {"method":
我正在使用Selenium尝试登录一个网站,但是当我尝试发送密钥时,我得到了以下错误:selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable。网址是:website。我希望任何人都能帮助我。 我的代码是: buttom = browser.find_element_by_class_name("loginInputs").find_element_by_class_name("passwordInput")
buttom.send
我试图通过传入用户名和密码登录到一个网站。我使用以下代码(Python3.5):
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
url2 = 'htt
我正在尝试编写一个python脚本,它使用多个帐户登录到Kahoot。我遇到了以下问题:我试图找到带有Selenium的'Enter‘按钮并单击它。但是我得到了这样的信息:selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":".enter-button__EnterButton-sc-1o9b9va-0 gS
我想使用python从facebook市场刮取数据,但是在运行脚本时没有显示任何数据。类ID在上面的图片中。
elements = driver.find_elements_by_class_name('l9j0dhe7 f9o22wc5 ad2k81qe') for ele in elements: print(ele.text) print(ele.get_attribute('title'))
我正在尝试获取上与给定类名匹配的所有元素。我试过driver.match_by_class_name,但奇怪的是只出现了第一个。
from collections import defaultdict
import json
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from se
我正在练习使用硒。我试着用漂亮的汤抓取这个页面,但由于页面需要一些时间加载,我用selenium尝试了一下,但增加了一个延迟时间。我也尝试过drive.delay和timeout。但对我来说什么都不是很好。我得到相同的错误与所有的尝试,我已经附上了我的最新尝试和错误,我得到了它。
这是我的ty:
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.ui import WebDriverWait
from sel
我正在使用python和selenium。我要扫描中的HTML并单击“正确的大小”。
每次执行for循环时,列表“tuplist”中的变量"s“将引用唯一的鞋大小。
当"s“等于8时,我需要代码遍历HTML,当它找到8大小时,单击它。(这将更新该特定尺寸的价格和销售数据)
for i, t, s in tuplist:
stockx = i
tickercounter = t
sizecounter = s
print('Pulling price data for shoe', tickercounter, 'size&