zoukankan      html  css  js  c++  java
  • python调用远程chromedriver.exe、selenium抓包方法

    本地python示例代码:
    from selenium import webdriver
    driver = webdriver.Remote(command_executor='http://192.168.99.10:9515')
    driver.get('http://www.cnblogs.com/sherlock-merlin')
    

    服务器端的chromedriver.exe启动时添加相关启动参数
    chromedriver.exe --whitelisted-ips
    或者
    chromedriver.exe --whitelisted-ips=192.168.99.20:9515
    前者接受所有连接,后者接受指定ip连接,推荐后者


    参考信息:

    chromedriver.exe --help
    
    Usage: chromedriver.exe [OPTIONS]
    
    Options
      --port=PORT                     port to listen on
      --adb-port=PORT                 adb server port
      --log-path=FILE                 write server log to file instead of stderr, increases log level to INFO
      --log-level=LEVEL               set log level: ALL, DEBUG, INFO, WARNING, SEVERE, OFF
      --verbose                       log verbosely (equivalent to --log-level=ALL)
      --silent                        log nothing (equivalent to --log-level=OFF)
      --replayable                    (experimental) log verbosely and don't truncate long strings so that the log can be replayed.
      --version                       print the version number and exit
      --url-base                      base URL path prefix for commands, e.g. wd/url
      --whitelisted-ips               comma-separated whitelist of remote IP addresses which are allowed to connect to ChromeDriver
    

  • 相关阅读:
    Mysql 的安装(压缩文件)和基本管理
    Mysql 数据库安装与配置详解
    Bootstrap的插件
    Bootstrap学习
    移动端单位介绍
    响应式页面-@media介绍
    前端 ---jQuery的补充
    前端 ---- jQuery的ajax
    前端 ----轮播图实现
    安装scrapy时遇到的问题
  • 原文地址:https://www.cnblogs.com/sherlock-merlin/p/10115499.html
Copyright © 2011-2022 走看看