我正在尝试构建一个脚本来使用selenium自动填充文本框,但是我似乎不能让它工作。
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as ec
import time
为什么我使用Python和Selenium收到这个错误,我如何修复它?
NameError: name 'ElementNotVisibleException' is not defined
在Python3.5中运行本教程中的以下脚本时会出现此错误
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver
这一点:
element = wait.until(EC.element_to_be_clickable((By.ID, 'username')))
出现此错误:
Traceback (most recent call last):
File "spammer.py", line 100, in <module>
bot()
File "spammer.py", line 75, in bot
element = wait.until(EC.element_to_be_clickable((By.ID,
背景:,我正在编写一个程序,每隔几天就会自动向FB上的某些联系人发送消息。
代码:
from selenium import webdriver
from selenium.webdriver.common.by import By
import selenium.webdriver.support.ui as UI
from selenium.webdriver.support import expected_conditions as EC
email = my_info['loginid']
password = my_info['password']
有一些奇怪的东西在继续。
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.
我正在使用下面的代码。
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.action_chains import ActionChains
import time
from s
我目前正在尝试打开登录页面,即“”,以填写“用户名”和“密码”字段,然后单击“登录”,所有这些都是用Python和Selenium自动完成的。
但我甚至不能填写第一个文本表格,也就是用户名。
这是我的密码:
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
在我的测试中,一些通过css selector定位的元素需要很长时间才能出现,因为服务器非常慢。在通过jenkins运行测试时,我经常会遇到这个错误,而不是在eclipse上本地运行。
> org.openqa.selenium.TimeoutException: Expected condition failed:
> waiting for visibility of element located by By.cssSelector:
> #ctl00_ContentPlaceHolder1_uctlSettingUpPaymentCollectionGrid1_gvG
我计划构建一个同时使用Selenium和BeautifulSoup的刮板。
我很难用selenium单击load按钮。我已经设法检测到按钮,滚动到它等-似乎找不出一种方法来持续点击按钮。
关于如何通过这个障碍,有什么建议吗?
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import TimeoutException, NoSuchElementException
from selenium.webdriver.comm
我试图让Selenium等待一个特定的元素(在页面底部附近),因为我必须等到页面完全加载。
我被它的行为搞糊涂了。
我不是Selenium方面的专家,但我希望这项工作:
from selenium import webdriver
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
driver = webdriver
我有一个python脚本,使用selenium转到给定的Instagram个人资料并迭代用户的关注者。在instagram网站上,当用户点击查看粉丝列表时,会打开一个弹出窗口,上面列出了这些账户(这里是a screenshot of the site) 然而,无论在视觉上还是在html中,只显示了12个帐户。为了查看更多内容,必须向下滚动,因此我尝试使用Keys.PAGE_DOWN输入进行此操作。 from selenium import webdriver
from selenium.common.exceptions import TimeoutException
fro
我正在尝试从下载数据以供我的研究之用。当页面打开时,会弹出通知窗口。我试图使用来关闭它。我的代码如下,
from selenium.webdriver import Chrome
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
driver = Chrome()
driver.get('https://p
我不得不刮一个电子商务网站,加载45个产品的第一页,随后加载额外的45个产品滚动到页面的结尾。
我正在使用Python,一个Selenium Web驱动程序来抓取这个页面。
Ajax似乎会在每次重新加载时替换容器,因此无法在加载所有产品后提取所有数据。
附加的代码为您的参考。请指导我如何刮掉所有的产品。
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
import pandas
from numpy import long
from selenium.we
我正在通过Selenium创建一个自动化的机器人,我过去常常使用普通的驱动程序来构建,以查看发生了什么。 机器人与普通的驱动程序工作得很好,但现在我想让它看不见,但问题出现了。我阅读了如何实现它,并在这里检查了类似的问题,但找不到解决方案。 以下是工作代码: from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as Expected
from sele
这个总共有790个产品,我编写了selenium代码来自动单击产品加载按钮,直到它完成所有790产品的加载。不幸的是,我的代码不工作,并得到一个错误。这是我的完整代码:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.suppor
我有一个python脚本,它列出了一长串网站的标题。这需要很长时间,所以脚本必须运行几个小时。然而,偶尔,我会得到错误“未能从木偶解码响应”。
根据我所读到的,错误背后的原因似乎并不是众所周知的。摆脱它不是我的首要任务,而是在脚本发生时不要完全停止,这就是当前出现错误时所发生的情况。
我该怎么做?
这是代码:
from pyvirtualdisplay import Display
from time import sleep
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
from selenium import
我对selenium很陌生,并尝试了一个检查器。
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException
def init_
我正在尝试使用selenium:自动填写这个网站中的表单,除了“微转移”之外,我可以填写所有的框。如果我尝试按我填写的方式点击这个,即:
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
elem = driver.find_element_by_xp
我正在尝试单击出现在图形右侧(图形上方三行)的按钮,最后想要单击"Download as CSV“。我的代码如下。
from selenium.webdriver.support.ui import WebDriverWait
from selenium import webdriver
import time
from selenium.webdriver.chrome.options import Options
driver = webdriver.Chrome(executable_path= ChromeDriver_Path, options = options)
dri
我正在尝试使用Selenium自动从网站下载歌曲,但当我试图找到所需的元素时,出现了一些问题。我使用了find_elements_by_xpath()方法。转到http://moresound.tk/music/#访问该网站。错误是TimeoutException,但是我的web浏览器已经显示了我想要的元素。你能告诉我出什么事了吗? # coding: utf-8
from selenium import webdriver
import re
from selenium.webdriver.support.ui import WebDriverWait
我知道这个问题已经被问到了,但我需要一些解决这个错误的方法:
Traceback (most recent call last):
File "goeventz_automation.py", line 405, in <module>
if login(driver) is not None:
File "goeventz_automation.py", line 149, in login
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//
我有以下代码:
from selenium import webdriver
from selenium.common.exceptions import WebDriverException
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import Select, WebDriverWait
from selenium.common.exception
我想在Google Colab中通过gecko驱动程序运行selenium,但它告诉我:可执行文件需要在PATH中 我在Google Colab上传了firefox和gecko驱动程序,并复制了gecko驱动程序的路径。代码在我的PC上运行得很好。 google clob中的firefox和gecko驱动程序,但出现错误。 from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait as wait
from selenium.webdriver.support import ex
当我试图访问flickr中的登录页面"raise TimeoutException(message,screen,stacktrace) selenium.common.exceptions.TimeoutException: Message“时,我得到了这个错误。
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait as wait
from selenium.webdriver.support import expected_condit
守则:
from selenium import webdriver
from time import sleep
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
driver=webdriver.Chrome(r"C:\Users\Desktop\chromedriver.exe")
driv