Git Product home page Git Product logo

Comments (8)

ancoka avatar ancoka commented on September 26, 2024

selenium.common.exceptions.SessionNotCreatedException: Message: session not created: Chrome failed to start: exited normally.

浏览器版本是多少,猜测可能是浏览器版本跟webdriver_manager版本不匹配

from hw_seckill.

haosechongzi avatar haosechongzi commented on September 26, 2024

def __browser_setting(self): print("{0} 开始设置浏览器参数".format(datetime.now())) options = webdriver.ChromeOptions() options.add_argument(r"--user-data-dir={}".format(self.__config_get("chrome", "userDataDir"))) options.add_argument(r"--profile-directory={}".format("Profile 5")) options.add_argument('--ignore-certificate-errors') options.add_argument('--ignore-certificate-errors-spki-list') options.add_argument('--ignore-ssl-errors') options.add_argument('--ignore-ssl-error') options.add_argument('--log-level=3') options.add_experimental_option('excludeSwitches', ['enable-logging']) browser = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options) print("{0} 设置浏览器参数完成".format(datetime.now())) browser.maximize_window() self.browser = browser

我给这里加了一行:options.add_argument('--headless')
就不报错了,运行下去了。这样的话就是无界面运行了。

from hw_seckill.

qiuzekai avatar qiuzekai commented on September 26, 2024

selenium.common.exceptions.SessionNotCreatedException:消息:会话未创建:Chrome 无法启动:正常退出。

浏览器版本是多少,猜测可能是浏览器版本与webdriver_manager版本不匹配

版本 117.0.5938.150(正式版本) (64 位)最新的版本

from hw_seckill.

qiuzekai avatar qiuzekai commented on September 26, 2024

def __browser_setting(self): print("{0} 开始设置浏览器参数".format(datetime.now())) options = webdriver.ChromeOptions() options.add_argument(r"--user-data-dir={}".format(self.__config_get("chrome", "userDataDir"))) options.add_argument(r"--profile-directory={}".format("Profile 5")) options.add_argument('--ignore-certificate-errors') options.add_argument('--ignore-certificate-errors-spki-list') options.add_argument('--ignore-ssl-errors') options.add_argument('--ignore-ssl-error') options.add_argument('--log-level=3') options.add_experimental_option('excludeSwitches', ['enable-logging']) browser = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options) print("{0} 设置浏览器参数完成".format(datetime.now())) browser.maximize_window() self.browser = browser

我给这里加了一行:options.add_argument('--headless') 就不报错了,运行下去了。这样的话就是无界面运行了。

我加了一行,然后就跟你最近的报错一样,卡在登录按钮那里了

from hw_seckill.

haosechongzi avatar haosechongzi commented on September 26, 2024

尝试了多种定位都不行,用selenium的录制功能CSS定位也定位不到,奇怪了。

from hw_seckill.

ancoka avatar ancoka commented on September 26, 2024

Author

加了--headless后,登陆按钮会定位不到

from hw_seckill.

qiuzekai avatar qiuzekai commented on September 26, 2024

我用了最新一版现在能跑起来了,等明天到点试试

from hw_seckill.

ancoka avatar ancoka commented on September 26, 2024

已经解决了,这个issue我关闭了

from hw_seckill.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.