我正在编写一个脚本来登录到我的银行帐户,使用Selenium和Python2.7。从历史上看,它是起作用的,但是现在它正在抛出一个ElementNotVisibleException异常。这是我的密码:
import time
import os
import subprocess
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support import ui
user_id = raw_input('Enter your
我读过很多其他堆栈溢出问题的答案,他们都说解决方案是使用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
我使用Selenium IDE记录了一个操作,并使用了File->Export Test Cases as Python2 (Remote Control)格式。
我使用的是Selenium RC 2.3.0
然后,我从命令提示符运行该脚本,但它抛出了一个异常。
导出的Python 2 RC代码为:
from selenium import selenium
import unittest, time, re
class login(unittest.TestCase):
def setUp(self):
self.verificationErrors = []
我尝试用python编写代码,使用selenium进行搜索,然后单击按钮。我的代码如下:
from selenium import webdriver
import time
path = 'C:\Program Files (x86)\chromedriver.exe'
driver = webdriver.Chrome(path)
driver.get("https://hopamviet.vn")
#import them
# from selenium.webdriver.support.ui import WebDriverWait
# from s
我对这条巨蟒和硒世界非常陌生。试图使用selenium自动使用python来实现一些无聊的东西。我对下面的xpath有问题。看来"="把事情搞砸了。
有人能帮忙吗?
L = driver.find_element_by_xpath("//*[@id="ext-comp-1016"]/div[1]/table/tbody/tr/td[2]/div[1]").click()
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to l
我正在努力从一个网站上抓取数据,并将数据写入CSV文件。然后在写入文件后更改页面,继续处理到最后一页。我只从第一行得到数据。我做错了什么。请纠正我。
import re
import os
import csv
import sys
import time
from selenium import webdriver
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
有几个函数与selenium一起工作,这些函数有特定的输出,但是当我在google中打开它们时,我得到了一些我不想要的输出,这降低了我的理解。
BETSWITSBOT
/usr/local/lib/python3.7/dist-packages/ipykernel_launcher.py:4: DeprecationWarning: find_elements_by_* commands are deprecated. Please use find_elements() instead
after removing the cwd from sys.path.
/usr/local/l
尝试使用selenium和下面构建脚本是我现在面临的问题。
下面是HTML源代码,Selenium建议为自动登录找到登录表单的"ID“值。但是在下面的例子中,没有ID值available.How来将其编码为autologin -在本例中?
下面的python代码失败,因为在下面给出的HTML代码中没有ID值
python代码:
from selenium import webdriver
driver = webdriver.Chrome()
browser = webdriver.Chrome() #replace with .Firefox(), or with the br
我只是做了一个硒机器人,作为一个有趣的项目,应该为我播放,我遇到了一些麻烦,让它等待倒计时之前,它试图开始打字。我找到这样做的最佳方法是等待文本输入字段可编辑,而不是等待倒计时弹出窗口消失,但正如我前面所说的,除非使用time.sleep()函数,否则我不能让它等待。这将不能很好地工作,因为我们可以等待任何地方,从5ish-12ish秒,然后才能启动机器人,以便它可能等待太长或不够长。我已经尝试过许多其他类似问题的解决方案,比如,但是到目前为止没有什么效果。
下面是我目前的代码:
#!/usr/bin/env/python3
import time
from selenium import