51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

查看: 4361|回复: 4
打印 上一主题 下一主题

求助大神,这个python+webdriver+phantomjs的代码,为什么会报错cookiejar不存在

[复制链接]
  • TA的每日心情
    开心
    2018-7-16 22:18
  • 签到天数: 2 天

    连续签到: 2 天

    [LV.1]测试小兵

    跳转到指定楼层
    1#
    发表于 2016-5-23 20:42:22 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    from selenium import webdrvier
    driver=webdriver.PhantomJS(ur"/home/kylinu/下载/phantomjs-1.9.6-linux-x86_64/bin/phantomjs")



    执行如下报错信息:
    Exception AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.phantomjs.service.Service object at 0x7f21279ff090>> ignored
    Exception AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.phantomjs.service.Service object at 0x7f21279ff110>> ignored
    Exception AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.phantomjs.service.Service object at 0x7f212a95c590>> ignored
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/home/kylinu/.local/lib/python2.7/site-packages/selenium/webdriver/phantomjs/webdriver.py", line 56, in __init__
        desired_capabilities=desired_capabilities)
      File "/home/kylinu/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 91, in __init__
        self.start_session(desired_capabilities, browser_profile)
      File "/home/kylinu/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 173, in start_session
        'desiredCapabilities': desired_capabilities,
      File "/home/kylinu/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 233, in execute
        self.error_handler.check_response(response)
      File "/home/kylinu/.local/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 165, in check_response
        raise exception_class(value)
    selenium.common.exceptions.WebDriverException: Message: Error - Cannot find module 'cookiejar'
    请大神指教

    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    收藏收藏
    回复

    使用道具 举报

  • TA的每日心情
    慵懒
    2021-12-24 13:41
  • 签到天数: 314 天

    连续签到: 1 天

    [LV.8]测试军长

    2#
    发表于 2016-5-24 09:56:06 | 只看该作者
    driver=webdriver.PhantomJS(ur"/home/kylinu/下载/phantomjs-1.9.6-linux-x86_64/bin/phantomjs")
    把这个换成
    driver = webdriver.PhantomJS(executable_path=r'/home/kylinu/下载/phantomjs-1.9.6-linux-x86_64/bin/phantomjs')  
    试试看行不行

    评分

    参与人数 1测试积点 +10 收起 理由
    lsekfe + 10 积极回复获得测试积点10

    查看全部评分

    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    开心
    2018-7-16 22:18
  • 签到天数: 2 天

    连续签到: 2 天

    [LV.1]测试小兵

    3#
     楼主| 发表于 2016-5-24 11:04:52 | 只看该作者
    掉渣饼 发表于 2016-5-24 09:56
    driver=webdriver.PhantomJS(ur"/home/kylinu/下载/phantomjs-1.9.6-linux-x86_64/bin/phantomjs")
    把这个 ...

    Python 2.7.11+ (default, Apr 17 2016, 14:00:29)
    [GCC 5.3.1 20160413] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from selenium import webdriver
    >>> driver = webdriver.PhantomJS(executable_path=r'/home/kylinu/下载/phantomjs-1.9.6-linux-x86_64/bin/phantomjs')  
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/home/kylinu/.local/lib/python2.7/site-packages/selenium/webdriver/phantomjs/webdriver.py", line 56, in __init__
        desired_capabilities=desired_capabilities)
      File "/home/kylinu/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 91, in __init__
        self.start_session(desired_capabilities, browser_profile)
      File "/home/kylinu/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 173, in start_session
        'desiredCapabilities': desired_capabilities,
      File "/home/kylinu/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 233, in execute
        self.error_handler.check_response(response)
      File "/home/kylinu/.local/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 165, in check_response
        raise exception_class(value)
    selenium.common.exceptions.WebDriverException: Message: Error - Cannot find module 'cookiejar'
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    开心
    2018-7-16 22:18
  • 签到天数: 2 天

    连续签到: 2 天

    [LV.1]测试小兵

    4#
     楼主| 发表于 2016-5-24 11:05:22 | 只看该作者
    掉渣饼 发表于 2016-5-24 09:56
    driver=webdriver.PhantomJS(ur"/home/kylinu/下载/phantomjs-1.9.6-linux-x86_64/bin/phantomjs")
    把这个 ...

    一样的呢。。。。也报错cookiejar的问题
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    开心
    2018-7-16 22:18
  • 签到天数: 2 天

    连续签到: 2 天

    [LV.1]测试小兵

    5#
     楼主| 发表于 2016-5-24 11:06:03 | 只看该作者
    掉渣饼 发表于 2016-5-24 09:56
    driver=webdriver.PhantomJS(ur"/home/kylinu/下载/phantomjs-1.9.6-linux-x86_64/bin/phantomjs")
    把这个 ...

    一样的呢。也报错cookiejar的问题
    回复 支持 反对

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-4-28 08:14 , Processed in 0.068889 second(s), 25 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表