爬虫工具之selenium二

进行代码调试时:

from selenium import webdriver

c=webdriver.Chrome(executable_path=r'C:\Program Files\Google\Chrome\Application\chrome.exe') #获取chrome浏览器的驱动,并启动Chrome浏览器
c.get('https://www.baidu.com')#打开百度
print('成功')

出现错误信息:

在这里插入图片描述

只能打开chrome浏览器,但无法打开指定的网址

1.检查host文件中是否包含“127.0.0.1 localhost”

在这里插入图片描述

2.ping localhost看是否连通(不连通的话考虑关闭防火墙)
参考python版selenium浏览器驱动问题Can not connect to the Service chromedriver解决

在这里插入图片描述

相关文章

转载地址:https://www.cnblogs.com/mini-monkey/p/12104821...
web自动化测试过程中页面截图相对比较简单,可以直接使用sel...
目录前言一、Selenium简介二、浏览器驱动1.浏览器驱动参考2....
一、iframe的含义:iframe是HTML中框架的一种形式,在对界面...
转载请注明出处❤️作者:测试蔡坨坨原文链接:caituotuo.to...
'''##**认识selenium**​**下载:pipinstall...