问 题

如题,代码如下:

import socket

socket.setdefaulttimeout(20)

chromepath = os.path.abspath(r"C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe")

driver = webdriver.Chrome(chromepath)

driver.get("https://www.baidu.com")

print driver.title

driver.close()

报错如下:

Traceback (most recent call last):

File "C:/Users/CurryXu/Desktop/selenium+phantomjs/experiment/joy.py", line 9, in

driver.get("https://www.baidu.com")

File "C:\Python27\lib\site-packages\selenium-3.0.1-py2.7.egg\selenium\webdriver\remote\webdriver.py", line 248, in get

self.execute(Command.GET, {'url': url})

File "C:\Python27\lib\site-packages\selenium-3.0.1-py2.7.egg\selenium\webdriver\remote\webdriver.py", line 234, in execute

response = self.command_executor.execute(driver_command, params)

File "C:\Python27\lib\site-packages\selenium-3.0.1-py2.7.egg\selenium\webdriver\remote\remote_connection.py", line 407, in execute

return self._request(command_info[0], url, body=data)

File "C:\Python27\lib\site-packages\selenium-3.0.1-py2.7.egg\selenium\webdriver\remote\remote_connection.py", line 439, in _request

resp = self._conn.getresponse()

File "C:\Python27\lib\httplib.py", line 1136, in getresponse

response.begin()

File "C:\Python27\lib\httplib.py", line 453, in begin

version, status, reason = self._read_status()

File "C:\Python27\lib\httplib.py", line 409, in _read_status

line = self.fp.readline(_MAXLINE + 1)

File "C:\Python27\lib\socket.py", line 480, in readline

data = self._sock.recv(self._rbufsize)

socket.error: [Errno 10054]

打开的chrome浏览器显示如下:

请问这是什么原因导致打开浏览器无反应呢

解决方案

扫一扫关注IT屋

微信公众号搜索 “ IT屋 ” ,选择关注与百万开发者在一起

python调用不起来chrome_python调用selenium打开chrome浏览器失败相关推荐

  1. python使用selenium打开chrome浏览器时带用户登录信息

    导读 我们在使用selenium打开google浏览器的时候,默认打开的是一个新的浏览器窗口,而且里面不带有任何的浏览器缓存信息.当我们想要爬取某个网站信息或者做某些操作的时候就需要自己再去模拟登陆 ...

  2. python获取登录按钮_Python:Selenium模拟Chrome浏览器抓取淘宝商品信息

    对于采用异步加载技术的网页,有时候想通过逆向工程的方式来设计爬虫进行爬取会比较困难,因此,要想通过python获取异步加载数据往往可以使用Selenium模拟浏览器的方式来获取. Selenium是一 ...

  3. [Mac] selenium打开Chrome浏览器

    在Mac电脑用python+selenium打开Chrome还遇到几个问题,这里总结下,以防忘记,也可帮到别人. 前提:已安装好python3,selenium 安装chromedriver 1.先查 ...

  4. selenium打开chrome浏览器无痕模式

    from selenium import webdriver options = webdriver.ChromeOptions() #无痕模式 options.add_argument('--inc ...

  5. selenium打开chrome浏览器闪退(进程结束后关闭浏览器)解决方法

    from selenium import webdriver from selenium.webdriver.chrome.options import Options options = Optio ...

  6. selenium打开chrome浏览器代码

    import os from selenium import webdriverchromedriver = "C:\Program Files (x86)\Google\Chrome\Ap ...

  7. Python爬虫:Selenium模拟Chrome浏览器爬取淘宝商品信息

    对于采用异步加载技术的网页,有时候想通过逆向工程的方式来设计爬虫进行爬取会比较困难,因此,要想通过python获取异步加载数据往往可以使用Selenium模拟浏览器的方式来获取. Selenium是一 ...

  8. selenium如何接管(控制)已打开Chrome浏览器

    一.目标 使用selenium接管已经打开的Chrome浏览器,并以百度网站为例,输出"百度一下"标签元素. 注:我的终端是windows系统,适用于windows系统 二.实现步 ...

  9. java中selenium设置chrome浏览器为开发者模式与IP代理

    java中selenium设置chrome浏览器为开发者模式与IP代理 前言 代码 前言 之前为公司写了个爬虫项目,有时候为了绕过网站的反爬机制需要用到ip代理以及设置浏览器为开发者模式,看了一些se ...

最新文章

  1. mysql清理连接数缓存,MySQL连接池、线程缓存、线程池的区别
  2. PostgreSQL的实践一:初识
  3. threshold函数
  4. 成功解决schedule.ScheduleValueError: Invalid time format
  5. 如何让页面停止加载_Axure 案例:数值加载效果
  6. 牛客网(剑指offer) 第九题 变态跳台阶
  7. JAVA中的Hashset类
  8. mysql 创建事件_mysql怎么建立事件
  9. 树上子链(树形dp求树的直径)
  10. 探索比特币源码9-顺藤摸瓜之通过RPC读源码
  11. 揭开 Python 内存分配时的小秘密!
  12. 文本过滤--grep 1
  13. b+树的增删改查_EF Core / 基础_从建库到增删改查
  14. letex编辑输出】pdf文件嵌入字体embedded fonts的问题
  15. WPS表格填充技巧大全
  16. 不输 MacType,这些优化思路也能让 Windows 字体细腻清晰
  17. Java聊天室yadiChat step1 登陆注册
  18. ssm房屋中介管理系统毕业设计(附源码、运行环境)
  19. English Reading - Thai cave rescue boys relive 'moment of miracle'
  20. 10-STM32F1-RTC and BKP

热门文章

  1. 2018 DDoS攻击加剧,闻“D”色变的无力困境,我们要怎么办
  2. 项目经历怎么写_工作经历、项目经验怎么写?
  3. Google中国招聘三大标准 实干、内功与人品
  4. defender 月考总结
  5. 周志华-机器学习 (绪论、模型评估与选择)
  6. 京瓷2010复印a4内容不全_京瓷1800打印机打印时设置了A4为什么打印不了复印正常...
  7. java 实现手机号码(String)校验----两种方法
  8. 计算到达18岁生日所经过的总天数
  9. CH32F103热敏打印机方案分享
  10. mysql 上下文切换_线程上下文切换