Comments (4)
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.
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.
@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.
, stdout=DEVNULL, stderr=DEVNULL
Thank you!
from drissionpage.
Related Issues (20)
- 功能请求 真心希望作者能给js_run加上返回值获取, 有些操作可能会依赖js运行来获取相应的返回值
- ChromiumPage实例化bug HOT 1
- i like this project
- 做了一个fastapi接口,但是长时间没有收到请求,与浏览器就会断开
- 最新测试版4.1.0.0b19遗漏WebPageTab
- 截图功能的一个小细节
- 由于以下原因无法打开网站 Incapsula Captcha
- .states.is_in_viewport找不到元素不是返回False而是直接报错?,找到元素能正常返回True
- 已解决,字典中的值是None导致page.set.cookies 报错 HOT 1
- 动作链无法绕过cloudflare的5s盾 HOT 1
- DP是否支持拦截并修改响应内容?
- eles() method for ShadowRoot bug - Error when using both css and xpath locator
- 在linux 环境下的无头浏览器 不支持录屏
- 请问有办法解决 "chrome is being controlled by automated software" 吗?
- 获取的cookies 好像不是很全
- ChromiumPage 设置代理好像不生效
- 调用drissionpage打开的google网页很卡,加载很慢 HOT 1
- 增加多設備模擬
- DrissionPage 已安装,但是 提示 No module named 'drissionpage',怎么办?
- page.quit()有问题 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from drissionpage.