在google检查控制台中输入xpath:
$x("/html/body/div/div/footer/md-toolbar/div/div[2]/img[2]/../../../../../../..//*[@id='input_15']")
控制台返回元素,因此xpath是正确的。
但是,在python控制台中,我的结果是它找不到元素,脚本是:
import unittest
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.web
我试图编写代码来点击网页中的画布中心。
以下代码如下:
private static void clickCanvasCenter() {
WebElement we = driver.findElement(By.tagName("canvas"));
int x = we.getSize().width/2;
int y = we.getSize().height/2;
Actions builder = new Actions(driver).moveToElement(new WebDriverWait(driver,20)
当使用chrome web驱动程序在selenium中使用send_keys和execute_script时,我无法在send_keys中检索任何搜索结果。
这是我到目前为止使用的代码:
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.common.k
我一直试图在弹出的selenium中单击一个按钮,但我得到了以下错误:
object [HTMLDivElement] has no size and location
我已经尝试了正常的方式,只需单击,因为它在视图中,我正在等待页面完全加载:
let pressCookieButton = await driver.findElement(By.xpath('//a[@class="btn-actiune btn-actiune--principal"]/..'))
await pressCookieButton.click();
但这行不通。上面写着
Ele
所以我试着识别这个按钮来按下它,但我得到了例外:
selenium.common.exceptions.NoSuchElementException:消息:没有这样的元素:无法定位元素
下面的图像显示了按钮:
奇怪的是,我已经识别了登录页面中的登录按钮,但是当我到达下面的页面后,就像识别一个元素已经不可能了,难道是因为页面不允许这样做吗?
#This one works
driver.find_element_by_class_name("urBtnStdNew").click()
#This one give the exception
driver.find_
我目前正在运行一些自动化测试,似乎名为"Next“的按钮不允许我对任何指示执行任何操作,如Xpath、ClassName或Tag_Name。在这种情况下我应该怎么做?
import requests
import json
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from config import get_web_driver_options
from config import get_chrome_web
大家好,我需要帮助。有网址:。正如您在屏幕截图中所看到的,我需要单击复选框Captcha。
这是我的代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Support.UI;
namespace AkaryakitSelenium
{
class P
我正在尝试使用Selenium WebDriver对链接进行基本的求职搜索。
import pandas as pd
import numpy as np
import time
from time import sleep
import sys
import re
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
sys.path.insert(0,'/usr/lib/chromium-browser/chromedriver')
from selenium.webdr
我正在尝试为reddit构建某种selenium 刮刀。然而,我确实发现自己在获取图中显示的时间戳时遇到了一些困难。
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.support.wait import WebDriverWait
from time import sleep # this should go at the top of the file
from bs4 import BeautifulSoup as
我是Python和Selenium的新手,我试图用选举数据(,下图中的html代码)在web上刮取一个页面。在这个页面上,我需要使用Selenium导航,因为在选择菜单中的项目时,url不会改变。作为第一步,我需要选择左上角的"División Geografica“按钮。我尝试使用find_element_by_xpath()导航到相应的标记。
但是,xpath导航只适用于#document和<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">行之外的标记。举个例子,driver.f
我是python和web scraping的新手。您的帮助我们将不胜感激。我在编程和练习方面是新手。我正在使用python和selenium进行web抓取。 我正在试着从事实上抓取数据。目标是找到过去24小时内发布的所有工作,并刮刮外部链接,这是在工作详细信息页面上与链接文本“申请公司网站”,标题,公司,名称,位置,工作描述。 我写了以下代码,但是它正确地获取了页面上的所有链接,然后当我试图打开每个链接时,它只打开了第一个链接。我怎样才能打开我一个接一个的链接。提前感谢,下面是我的代码示例: import time
from selenium import webdriver
from se
我试图在Selenium web-driver(java)中获取permission key的值,但我无法识别该元素。有没有人能帮我找出元素并获取"4BF12-50763-166E0"的值。
有9个span类具有相同的名称,很难识别相同的类。
网页部分如下所示,我想获取下面每个元素的值,如version,status等。所有这些元素都出现在span类中,如下图所示。
任何建议都会有很大帮助。
Version 1.2
Status Enabled
Days left