Code Monkey home page Code Monkey logo

Comments (4)

g1879 avatar g1879 commented on August 26, 2024

Sorry I didn't know that, there information doesn't appear on Windows, which I almost exclusively use.
If you find a solution, please let me know, I will write it in the document.

from drissionpage.

Krylanc3lo avatar Krylanc3lo commented on August 26, 2024

ok thanks. it seems that we could possibly use experimental_option but I am not able to add it:

options.add_experimental_option('excludeSwitches', ['enable-logging'])

So I tried to add this option in configs.ini file but it does not work:

experimental_options = {'prefs': {'excludeSwitches': ['enable-logging'], 'profile.default_content_settings.popups': 0, 'profile.default_content_setting_values': {'notifications': 2}}}

I will continue to investigate and let you know if I find anything.

Thanks again for your package and help!

from drissionpage.

Krylanc3lo avatar Krylanc3lo commented on August 26, 2024

@g1879, here is the fix: we need to redirect the stdout in commons/browser.py when we launch chrome:

return Popen(arguments, shell=False, stdout=DEVNULL, stderr=DEVNULL)

from subprocess import Popen, DEVNULL
...
def _run_browser(port, path: str, args) -> Popen:
    """创建chrome进程
    :param port: 端口号
    :param path: 浏览器地址
    :param args: 启动参数
    :return: 进程对象
    """
    p = Path(path)
    p = str(p / 'chrome') if p.is_dir() else str(path)
    arguments = [p, f'--remote-debugging-port={port}']
    arguments.extend(args)
    try:
        return Popen(arguments, shell=False, stdout=DEVNULL, stderr=DEVNULL)
    except FileNotFoundError:
        raise FileNotFoundError('未找到浏览器,请手动指定浏览器可执行文件路径。')

from drissionpage.

g1879 avatar g1879 commented on August 26, 2024

, stdout=DEVNULL, stderr=DEVNULL

Thank you!

from drissionpage.

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.