环境:Win7
      Firefox浏览器版本37.0.1
      Python36
      Selenium2.53.0

在Pycharm里执行以下3行脚本:

from selenium import webdriver
browser = webdriver.Firefox()
browser.get("http://www.baidu.com")

报错如下:

File "/python36/Lib/site-packages/selenium/webdriver/firefox/webdriver.py", line 62, in __init__  
firefox_options.binary_location = self.binary if isinstance(self.binary, basestring) else self.binary._get_firefox_start_cmd()
NameError: name 'basestring' is not defined

解决方法:将2.53.0版本的selenium卸载掉,安装2.53.1版本的selenium

Firefox37.0.1+selenium 2.53+python3.6打开浏览器时报错NameError: name 'basestring' is not defined的更多相关文章

  1. python3中启动 uiautomator2viewer时报错解决办法

    事先说明:我电脑里同时了安装了 python2和python3,启动对应版本时分别带上版本号,如何设置共存请参考:python2与python3共存 打开命令窗口,启动weditor : python ...

  2. py+selenium 报错NameError: name 'NoSuchElementException' is not defined【已解决】

     报错:NameError: name 'NoSuchElementException' is not defined  如图 解决方法: 头部加一句:from selenium.common.exc ...

  3. python3.6中使用selenium + chromedriver访问Chrome浏览器时报错

    from selenium import webdriver from selenium.webdriver.chrome.options import Options if __name__ == ...

  4. selenium:能够模拟人类打开浏览器的爬虫利器

    介绍 selenium相当于是一个机器人,可以模拟人类登陆浏览器的行为,比如点击.填充数据.删除cookie等等.Chromedriver是一个驱动Chrome的程序,使用它才可以驱动浏览器,其实Ch ...

  5. python+selenium,打开浏览器时报selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH

    有一年多没写web自动化了,今天搭建环境的时候报了一个常见错误,但是处理过程有点闹心,报错就是常见的找不到驱动<selenium.common.exceptions.WebDriverExcep ...

  6. python+selenium打开浏览器报错问题

    报关键字,升级selenium版本 若打开IE浏览器,停在IE界面,无法跳转对应的地址,设置一下IE的页面缩放,设置为100%

  7. 使用版本 1.0.0 的 Azure ARM SDK for Java 创建虚拟机时报错

    问题描述 我们可以通过使用 Azure ARM SDK 来管理 Azure 上的资源,因此我们也可以通过 SDK 来创建 ARM 类型的虚拟机,当我们使用 1.0.0 版本的 Azure SDK fo ...

  8. selenium 打开浏览器报错java.lang.NoSuchMethodError: org.openqa.selenium.chrome.ChromeOptions.addArguments([Ljava/lang/String;)

    java.lang.NoSuchMethodError: org.openqa.selenium.chrome.ChromeOptions.addArguments([Ljava/lang/Strin ...

  9. linux python3安装whl包时报错解决:is not a supported wheel on this platform

    原因1 你下载安装的包不是当前平台所支持的 原因2 你下载的包,不符合你所在的平台的安装whl的名称规范,所以出错.比如当前我要安装的包是:pymssql-2.1.5-cp36-cp36m-manyl ...

随机推荐

  1. Scrapy反爬

    1,随机更换 user-agent: 将足够多的user-agent放在settings中,在parse方法中调用 缺点:每一个request中都要调用这个方法 这个是scrapy的流程图. 既然每一 ...

  2. js函数内未声明变量

    <script> function test(){ testd = "Hello"; } test(); alert(testd); </script> 当 ...

  3. Centos7 进入单用户模式,修复系统

    一.开机时进入如下界面,(按下方向键盘,阻止系统自动继续) 按e键出现下面界面 按方向键下,定位到最后,找到“ro”一行,ro的意思是read only,将“ro”替换成 rw init=/sysro ...

  4. VS2015 提示 无法启动 IIS Express Web 服务器

    好久没有写东西了,不是没的写,是没时间了,今天快下班了,正好遇到这个一个问题,我就记录下来,以防忘记. 我定义了一个项目,Demo代码也写好了,然后,我们就把写好的项目代码加入到了源代码管理工具里.然 ...

  5. bootstrap 辅助工具

    模板  https://startbootstrap.com/ 可视化bootstrap在线编辑器 https://www.layoutit.com/

  6. 查看class实际执行的类路径

    查看class真实归属的jar包位置getClass().getClassLoader().getResource(getClass().getName().replace('.', '/') + & ...

  7. Python Day 2

    阅读目录: 内容回顾   编程语言介绍 python语言介绍  安装官方cpython解释器 --版本共存  运行python代码   --交互式:实时交互   --脚本式:运行py文件的三步骤 变量 ...

  8. 判断jquery对象是否具有某指定属性或者方法的几种方法

    1.typeof 运算符:返回一个用来表示表达式的数据类型的字符串.("number", "string", "boolean", &quo ...

  9. const和static readonly 区别

    const的值是在编译期间确定的,因此只能在声明时通过常量表达式指定其值. 而static readonly是在运行时计算出其值的,所以还可以通过静态构造函数来赋值. static readonly ...

  10. Leeetcode--581. Shortest Unsorted Continuous Subarray

    Given an integer array, you need to find one continuous subarray that if you only sort this subarray ...