# encoding:utf-8

"""
@version: python27
@author: fafa
@site: http://www.phpgao.com
@software: PyCharm Community Edition
@file: chromeserver.py
@time: 2018/7/29 0029 下午 5:24
"""
import time
from selenium import webdriver class ChromeServerParse(object):
def __init__(self):
# chromedriver的路径
self.excute_path = "D:\\Python\\Python37\\Scripts\\chromedriver.exe"
# 指定chromedriver启动的端口
self.port = 8080
# 指定chromedriver service 启动的参数
self.service_args = ["lang=zh_CN.UTF-8", "--start-maximized", '--disable-infobars']
self.option = webdriver.ChromeOptions()
# 设置字符编码
self.option.add_argument("lang=zh_CN.UTF-8")
# 窗口最大化
self.option.add_argument("start-maximized")
# 隐身模式
self.option.add_argument("incognito")
# 阻止弹出框
self.option.add_argument('disable-infobars') def start_chromedriver(self):
self.driver = webdriver.Chrome(
executable_path=self.excute_path,
port=self.port,
service_args=self.service_args,
chrome_options=self.option)
driver = self.driver
driver.get("http://www.baidu.com")
time.sleep(5) if __name__ == '__main__':
ChromeServerParse().start_chromedriver()

python chrome的自定义启动的更多相关文章

  1. Windows下的Jupyter Notebook 安装与自定义启动(图文详解)

    不多说,直接上干货! 前期博客 Windows下的Python 3.6.1的下载与安装(适合32bits和64bits)(图文详解) 这是我自定义的Python 的安装目录 (D:\SoftWare\ ...

  2. Windows下的Jupyter Notebook 安装与自定义启动

    1.Jupyter Notebook 和 pip 为了更加方便地写 Python 代码,还需要安装 Jupyter notebook. 利用 pip 安装 Jupyter notebook. 为什么要 ...

  3. Selenium Chrome浏览器的启动以及proxy设置

    Selenium Chrome浏览器的启动以及proxy设置   虽然WebDriver对Firefox的支持最好,之前写的脚本也都在Firefox浏览器运行,但最近项目做了整合,发现新整合的功能不太 ...

  4. seleniu+python+chrome的调试

    1.下载chrome,下载chrome driver,下载地址:http://code.google.com/p/chromedriver/downloads/list 2.安装chrome,默认路径 ...

  5. 重新想象 Windows 8 Store Apps (69) - 其它: 自定义启动屏幕, 程序的运行位置, 保持屏幕的点亮状态, MessageDialog, PopupMenu

    [源码下载] 重新想象 Windows 8 Store Apps (69) - 其它: 自定义启动屏幕, 程序的运行位置, 保持屏幕的点亮状态, MessageDialog, PopupMenu 作者 ...

  6. chrome浏览器插件启动本地应用程序

    chrome浏览器插件启动本地应用程序 2014-04-20 00:04:30|  分类: 浏览器插件|举报|字号 订阅     下载LOFTER我的照片书  |     chrome的插件开发这里就 ...

  7. python 的几种启动方式

    python 的几种启动方式 (1)利用Win的操作系统的:命令行工具 cmd.exe Win + R  调出运行对话框,然后输入cmd,即可调出“命令提示符对话框” 或者 在菜单中店家附件中的命令提 ...

  8. python+selenium之自定义封装一个简单的Log类

    python+selenium之自定义封装一个简单的Log类 一. 问题分析: 我们需要封装一个简单的日志类,主要有以下内容: 1. 生成的日志文件格式是 年月日时分秒.log 2. 生成的xxx.l ...

  9. SpringBoot2.0 基础案例(17):自定义启动页,项目打包和指定运行环境

    本文源码 GitHub地址:知了一笑 https://github.com/cicadasmile/spring-boot-base 一.打包简介 springboot的打包方式有很多种.可以打war ...

随机推荐

  1. 基本数据对象(int,float,str)

    一.整型(int) # int对象初始化 x = 2 y = int(3) n = int("A3",12) # 运算符(+.-.*././/.%.**) ''' 相关的函数 '' ...

  2. 外部访问docker中的MySQL

    注:192.168.1.203机器上装有docker,容器在该机器上 mysql> use mysql; mysql> update user set authentication_str ...

  3. 洛谷 P1101 单词方阵

    题目链接 https://www.luogu.org/problemnew/show/P1101 题目描述 给一n×n的字母方阵,内可能蕴含多个"yizhong"单词.单词在方阵中 ...

  4. Python第二天: 变量详解及变量赋值

    目录 什么是变量? 怎么写一个好的变量? 下划线命名法及驼峰命名法 结语 目录 此文章针对刚学Python的小白,若觉得对变量有很好的掌握,可以观看其他的文章 在这里, 我说一下我对变量的简单总结: ...

  5. ubuntu安装docker{ubuntu16.04下安装docker}

       一.开始安装 第一步:   由于apt官方库里的docker版本可能比较旧,所以先卸载可能存在的旧版本: $ sudo apt-get remove docker docker-engine d ...

  6. UOJ188 Sanrd Min_25筛

    传送门 省选之前做数论题会不会有Debuff啊 这道题显然是要求\(1\)到\(x\)中所有数第二大质因子的大小之和,如果不存在第二大质因子就是\(0\) 线性筛似乎可以做,但是\(10^{11}\) ...

  7. 【转】详解springboot-修改内置tomcat版本

    1.解析Spring Boot父级依赖 <parent> <groupId>org.springframework.boot</groupId> <artif ...

  8. python使用redis

    版本: python 3.5 redis 3.0.1(redis的安装 pip install redis) 1.连接 import redis r = redis.Redis(host='192.1 ...

  9. Command "python setup.py egg_info" failed with error code 1 in c:\users\w5659\appdata\local\temp\pip-build-fs2yzl\ipython\

    Error Msg: Collecting ipython Using cached https://files.pythonhosted.org/packages/5b/e3/4b3082bd7f6 ...

  10. es6箭头函数 this 指向问题

    es5中 this 的指向 var factory = function(){ this.a = 'a'; this.b = 'b'; this.c = { a:'a+', b:function(){ ...