selenium

作者: 慧琴如翌 | 来源:发表于2018-03-25 19:25 被阅读26次

刚开始学selenium的时候,需要搭建环境

  1. pip install selenium
  2. 下载chromedriver后
    cp /Users/fujunmin/Downloads/chromedriver /Users/fujunmin/anaconda/bin
    cp /Users/fujunmin/Downloads/chromedriver /usr/local/bin/
  3. 运行pycharm中的脚本
    from selenium import wedriver
    报错:
    no name wedriver
    后来查找了半天是因为脚本得名称叫“selenium.py” 想哭/(ㄒoㄒ)/~~
    之前也犯过类似的错误,又一次。。。
    将脚本名字改了就不报这个错了
    解决报错:
    selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
    解决办法:
    下载geckodriver文件,然后执行命令即可
    cp /Users/fujunmin/Downloads/geckodriver /Users/fujunmin/anaconda/bin

相关文章

网友评论

    本文标题:selenium

    本文链接:https://www.haomeiwen.com/subject/oalkcftx.html