import selenium
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
# FIRST - GET THE WEBPAGE
url = "https://op.europa.eu/en/web/who-is-who/organization/-/organization/EP/EP"
driver = webdriver.Chrome("C:/Users/XXX/Downloads/chromedriver_win32/chromedrive
我正在抓取一个页面,我不记得如何在一个在另一个变量中使用selenium的字符串中运行一个变量
from selenium import webdriver
from selenium.webdriver.common.by import By
len_trs_table=6
for i in range(0,int(len_trs_table)):
tr = driver.find_element(By.XPATH,'/html/body/div[5]/div[8]/div/div[2]/div/div[3]/fieldset/div/div[1]/div/div[
我正在尝试编写一个程序,显示来自网站的文本。文本所在的类具有相同的名称。我试过做xpath,但是我不能让它工作。我真的不知道如何解释我的问题,很抱歉。
from selenium.webdriver.common.keys import Keys
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support i
好的,我正在用Selenium Web驱动程序编写一个简单的代码。它所做的是:
开放URL Google.com
在搜索栏中输入'abc‘
单击“图像”选项卡
我使用的是windows 8-64位和Visual 2013。浏览器是Firefox。
下面是我写的代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OpenQA.Selenium;
using OpenQA
我需要你的帮助。我试图使用Python2.7中的Selenium从tripadvisor中获取一些数据。然而,我在某一时刻被困住了。
在浏览到正确的页面后,我尝试在特定的价格上过滤酒店。要做到这一点,您可以通过鼠标单击“价格”,然后选择类似的批准值(欧元3欧元-13欧元)。
点击价格后,再按价值。我得到的错误是,元素是不可见的或无法定位的,而它是明显可见的。
代码
from urllib import urlopen
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
fr
我正在尝试使用PyCharm中的selenium/python登录我的Garmin帐户。我知道有一个API,但由于这是为了培训目的,我真的很想通过网站达到我的目标。
我的代码:
import scrapy
import time
from scrapy_selenium import SeleniumRequest
from scrapy.selector import Selector
from selenium.webdriver.support.ui import WebDriverWait as wait
from selenium.webdriver.common.by impor
我正在尝试使用python中的selenium在facebook上发布信息。我可以登录,但登录后找不到我从浏览器复制的状态框的类名。
这是我的密码-
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
user_name = "email"
password = "password"
msg = "hi i am new here"
driver = webdriver.Firefox()
driver.get
我需要用c#在selenium中创建一个测试自动化工具来测试我公司的网站。一切都很好,除了一件事:每当我在网站上重新加载一个任务(比如“创建新用户”)时,一些字段的XPath就会发生变化。例如,name字段不是"//*[@id=\"0FirstName\"]" anymore, the new xpath would be "//*[@id=\"2FirstName\"]",selenium不再像->程序停止工作之前那样识别该字段。
是否有一种方法可以使动态函数忽略电子邮件前的数字?
driver.FindElement(B
我读过很多其他堆栈溢出问题的答案,他们都说解决方案是使用find_elements,但我的代码仍然一无所获,有人能帮上忙吗?我试着做我的代码,类似于我将如何使用美丽的汤,谢谢!
这是我的密码:
import selenium.webdriver as webdriver
from selenium.webdriver.support.ui import WebDriverWait, Select
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.firefox.opt
我正在使用Java中的Webdriver登录Instagram:
WebDriver driver = new ChromeDriver();
//open instagram.com:
driver.get("https://www.instagram.com");
//type my_username in the user text box
WebElement user = driver.findElement(By.xpath("//*[@id=\"loginForm\"]/div/div[1]/div/label/input"
我正在学习如何使用Selenium。我在做一些测试,但是得到了一个错误:
selenium.common.exceptions.NoSuchElementException:消息:无法定位元素:.layout布局基
我的守则:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from webdriver_manager.firefox import GeckoDriverManager
from selenium.webdriver.common.by import By
driv
Selenium的一个问题是,当页面大量使用AJAX请求时,Selenium不知道请求何时结束,因此不知道何时应该开始向页面查询所请求的元素。
我解决这个问题的想法是在页面中放置一个不可见的div,它将包含一个计数器,该计数器在每次AJAX请求完成时递增:
<!-- will be v1v after first AJAX requext, v2v after the second etc. -->
<div style="display: none;" id="ajaxcounter">v0v</div>
所以在Seleni
我正在使用Python和Selenium来抓取网页。
我试图在页面中找到以下“下一页”按钮:
<button class="pagination__next" aria-label="click to go to the next page" disabled="true" aria-hidden="true"></button>
当我在多页嵌入式javascript生成表的最后一页时,disabled='true'就会出现。
可能有更多的按钮在页面上,有些是禁用时,我正在寻找这个特定的按钮
我对Selenium相当陌生,我试图在页面中找到一个联系人信息元素,如果它存在的话点击它。很多时候,元素都是大写的,比如CONTACT,有时是Contact,有时是contact。因此,我将这些情况存储在一个变量中,并使用find_element_by_partial_link_text查找正确的元素并单击它。我使用异常处理(尝试和例外)和if循环来检查每个条件。这是我的密码:
from selenium import webdriver
import time
from selenium.common.exceptions import NoSuchElementException, Sta
我在使用Windows上的Firefox输入我的用户名和密码时遇到了问题,由于某些原因,我不允许输入电子邮件和密码,我尝试使用诸如: ID、CSS、Class.但它向我展示了错误信息:
ElementNotInteractableException:消息:元素不能通过键盘到达
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_