selenium python脚本_selenium中的Python脚本

作为Selenium和Python的新手,在尝试运行从Selenium IDE导出的脚本时遇到了错误:AttributeError: 'Service' object has no attribute 'log_file'。错误发生在Firefox webdriver初始化时,由于权限问题无法打开'geckodriver.log'文件。解决方案可能包括更新或正确配置geckodriver路径,确保具有写入权限。已经尝试下载并安装geckodriver.exe,但遇到了执行问题。
摘要由CSDN通过智能技术生成

我对selenium和python都是新手。在

我已经从selenium IDE导出了脚本,当我试图用python执行脚本时,我收到了如下错误:EException AttributeError: "'Service' object has no attribute 'log_file'" in

und method Service.__del__ of

at 0x0000000002AA4550>> ignored

======================================================================

ERROR: test_sharepoint_python (__main__.SharepointPython)

----------------------------------------------------------------------

Traceback (most recent call last):

File "D:\scripts\sharepoint python1.py", line 12, in setUp

self.driver = webdriver.Firefox()

File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\webdriver.py",

line 139, in __init__

self.service = Service(executable_path, log_path=log_path)

File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\service.py", li

ne 45, in __init__

log_file = open(log_path, "a+")

IOError: [Errno 13] Permission denied: 'geckodriver.log'

----------------------------------------------------------------------

Ran 1 test in 0.030s

FAILED (errors=1)

请告诉我怎么才能修好这个。看过其他帖子提到更新壁虎之路。如果问题解决了,让我知道我在哪里找到壁虎河。但我看不到任何地方壁虎.log尝试下载并安装geckodriver,但exe未执行

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值