我对Python非常陌生,还在努力解决所有问题。
当我试着用手刮网的时候,我遇到了一个问题:
当搜索结果页面出现时,该网站需要一个标志和弹出,有时还需要滚动和查看结果。因此,我需要按转义,然后悬停在(或我可以点击它)“在”下拉菜单中的“签名”,并单击:“登录”在下拉菜单。
但是现在,从教育的角度来看,我想使用鼠标的XPath将鼠标移到元素中。
我做了下面的工作,但不起作用。
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.w
selenium: 3.141.0,语言:Python3。
在访问下面的显式等待方法时,我得到了以下错误。
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import Select
from selenium.webdriver.support.ui import WebDriverWait
几天前,我将python从3.3.2更新到3.5.1,几天前,通过在某些功能上提供帮助,我发现了一些奇怪的东西,一些函数的公司中有一个/,例如:
在3.3.2中
>>> help(len)
Help on built-in function len in module builtins:
len(...)
len(object) -> integer
Return the number of items of a sequence or mapping.
>>>
现在3.5.1
>>> help(len)
Hel
我有这个地址,"6425火溪Trl“。我正在使这个过程自动化。我无法理解并请求您的友好帮助是如何告诉Selenium单击第一个搜索结果(许可号B13-1351),这个地址在搜索中被复制后就会出现。我搜索了网页的来源,但没有找到任何进展。
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expec
我对python这个世界很陌生,我试图在下面的网站上选择几个选项,然后单击search按钮来更新结果。然而,我无法得到按钮的回应。
我尝试使用search button.click()和.submit(),并且尝试隐式地等待。我还使用了下面的代码来等待按钮被点击。在执行代码时,它高亮显示按钮,但似乎没有释放单击;几乎就像单击了一半。
from selenium import webdriver
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.keys import Keys
from
我是硒的新手,我只是在探索。我试图在youtube上搜索一个关键字,在python中使用Selenium。我遇到了一些错误。
这是密码
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.wait import WebDriverWait
driver = webdriver.Ch
我正在使用这段代码来创建一个填充数据本身的脚本
代码片段#1完成后,在按login后在同一轻击中打开一个新页面。我想使用代码片段#2来查找按钮代码刷新并单击它,但每次我都得到一个错误,如下所示:
代码片段#1
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import re
import time
browser = webdriver.Firefox()
browser.get('the url')
user = browser.find_element_by_
我有一个非常简单的程序,打开并点击第一个链接。我使用WebDriverWait确保元素已经准备好被单击,尽管它仍然不工作,输出和错误。
代码:
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions
import time
wd = webdriver.Firefox()
我正在尝试创建一个机器人,每当需要的元素可以单击/可见时,它就会自动刷新和停止。我已经完成了刷新部分,而bot在看到所需的元素时就停止了,但是我不知道为什么它不单击元素:/
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
dri
我试图专注于twitter.com/login和send_keys('foo')上的电子邮件输入,但是我没有运气。有人能告诉我为什么我的实现是错误的吗?
import time
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from selenium import webdriver
class MySpider(BaseSpider):
name = "new"
allowed_domains = ["twit
嘿,我有这个网站:,我想搜索我的查询,并通过单击它来获得第一个结果url。我该怎么做呢?我尝试单击element并发送查询,但出现了一些错误。
代码如下:
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.by import By
from se
我试图通过使用selenium的python脚本自动从网站下载数据,但我得到了以下错误:
"WebDriverException: Message: TypeError: rect is undefined".
代码试用:
from selenium import webdriver
from selenium.webdriver.common import action_chains
driver = webdriver.Firefox()
url="https://www.hlnug.de/?id=9231&view=messwerte&detai
我试图使用selenium编写python脚本,将数据输入到javascript表单中。
我继续得到一个错误,无法找到该元素。这就是我迄今为止尝试过的:
from time import sleep
from selenium import webdriver
from datetime import datetime
eGBS = "xxxxx" #removed web address b/c of company info
rpt = '' #removed web address b/c of company info
wb = webdriver.C
我正在尝试编写一个脚本来处理具有多个元素的网页。该元素一旦单击,将导致一个新窗口。但是我的脚本在识别元素方面有问题。我需要帮助定位元素和处理多个窗口。
我试着使用Chrome找到Xpath,但在中却不一样。我还试过使用CSS选择器,它不起作用。说是无效的。
函数test_google_search_page: def test_google_search_page(self):driver=self.driver driver.get("") str1=driver.title print(str1)的代码
#get the window handles using w
忽略葡萄牙语的评论
from selenium import webdriver
from time import sleep
from bs4 import BeautifulSoup
from selenium.webdriver.common.by import By
driver=webdriver.Chrome('C:/Users/LENOVO/Desktop/WEB SCRAPPING/Selenium/chromedriver.exe')#padrão
driver.get('https://stackoverflow.com/questions/726
所以我试着从视频mp4 上得到这个网址。我试图定位div并点击它,但它甚至没有找到它。因此,我尝试在其中定位svg并成功地找到它,但是每当我试图点击它时,尝试获取由网站发出的请求,我不会得到请求,元素也不会被点击。每当我尝试不点击它时,我就会得到请求,但当我试图单击时,我只得到错误和堆栈跟踪-
“守则”
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from seleniumwire import webdriver # Import from
from seleniu