Python: How to hide output message?
up vote
1
down vote
favorite
What I want to do:
I want to open chrome browser using selenium-chromeDriver.
What I did:
from selenium import webdriver
driver = webdriver.Chrome(r'C:Usersu1Documentsscriptschromedriver.exe')
Output:
C:Usersu1Documentsscripts>python test.py
DevTools listening on ws://127.0.0.1:50605/devtools/browser/11c9063a-44ce-4b39-9566-9e6c6270025c
What I tried to solve this:
I wanted to hide the output message "DevTools listening on ... "
Using contextlib
from selenium import webdriver
import contextlib
with contextlib.redirect_stdout(None):
driver = webdriver.Chrome(r'C:Usersu1Documentsscriptschromedriver.exe')
Using devnull
from selenium import webdriver
import subprocess
devnull = subprocess.DEVNULL
subprocess.Popen(open_browser(), stdout=devnull, stderr=devnull)
def open_browser():
driver = webdriver.Chrome(r'C:Usersu1Documentsscriptschromedriver.exe')
But still the message is getting displayed. How to hide the output message "DevTools listening on ... " in python?
python python-3.x selenium selenium-webdriver selenium-chromedriver
add a comment |
up vote
1
down vote
favorite
What I want to do:
I want to open chrome browser using selenium-chromeDriver.
What I did:
from selenium import webdriver
driver = webdriver.Chrome(r'C:Usersu1Documentsscriptschromedriver.exe')
Output:
C:Usersu1Documentsscripts>python test.py
DevTools listening on ws://127.0.0.1:50605/devtools/browser/11c9063a-44ce-4b39-9566-9e6c6270025c
What I tried to solve this:
I wanted to hide the output message "DevTools listening on ... "
Using contextlib
from selenium import webdriver
import contextlib
with contextlib.redirect_stdout(None):
driver = webdriver.Chrome(r'C:Usersu1Documentsscriptschromedriver.exe')
Using devnull
from selenium import webdriver
import subprocess
devnull = subprocess.DEVNULL
subprocess.Popen(open_browser(), stdout=devnull, stderr=devnull)
def open_browser():
driver = webdriver.Chrome(r'C:Usersu1Documentsscriptschromedriver.exe')
But still the message is getting displayed. How to hide the output message "DevTools listening on ... " in python?
python python-3.x selenium selenium-webdriver selenium-chromedriver
Check this discussion stackoverflow.com/questions/52245604/…
– DebanjanB
Nov 19 at 11:22
I already checked that answer. That answer did not solve this issue. So, I try to solve it in a different way.
– Dipankar Nalui
Nov 19 at 12:45
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
What I want to do:
I want to open chrome browser using selenium-chromeDriver.
What I did:
from selenium import webdriver
driver = webdriver.Chrome(r'C:Usersu1Documentsscriptschromedriver.exe')
Output:
C:Usersu1Documentsscripts>python test.py
DevTools listening on ws://127.0.0.1:50605/devtools/browser/11c9063a-44ce-4b39-9566-9e6c6270025c
What I tried to solve this:
I wanted to hide the output message "DevTools listening on ... "
Using contextlib
from selenium import webdriver
import contextlib
with contextlib.redirect_stdout(None):
driver = webdriver.Chrome(r'C:Usersu1Documentsscriptschromedriver.exe')
Using devnull
from selenium import webdriver
import subprocess
devnull = subprocess.DEVNULL
subprocess.Popen(open_browser(), stdout=devnull, stderr=devnull)
def open_browser():
driver = webdriver.Chrome(r'C:Usersu1Documentsscriptschromedriver.exe')
But still the message is getting displayed. How to hide the output message "DevTools listening on ... " in python?
python python-3.x selenium selenium-webdriver selenium-chromedriver
What I want to do:
I want to open chrome browser using selenium-chromeDriver.
What I did:
from selenium import webdriver
driver = webdriver.Chrome(r'C:Usersu1Documentsscriptschromedriver.exe')
Output:
C:Usersu1Documentsscripts>python test.py
DevTools listening on ws://127.0.0.1:50605/devtools/browser/11c9063a-44ce-4b39-9566-9e6c6270025c
What I tried to solve this:
I wanted to hide the output message "DevTools listening on ... "
Using contextlib
from selenium import webdriver
import contextlib
with contextlib.redirect_stdout(None):
driver = webdriver.Chrome(r'C:Usersu1Documentsscriptschromedriver.exe')
Using devnull
from selenium import webdriver
import subprocess
devnull = subprocess.DEVNULL
subprocess.Popen(open_browser(), stdout=devnull, stderr=devnull)
def open_browser():
driver = webdriver.Chrome(r'C:Usersu1Documentsscriptschromedriver.exe')
But still the message is getting displayed. How to hide the output message "DevTools listening on ... " in python?
python python-3.x selenium selenium-webdriver selenium-chromedriver
python python-3.x selenium selenium-webdriver selenium-chromedriver
asked Nov 19 at 10:21
Dipankar Nalui
2161416
2161416
Check this discussion stackoverflow.com/questions/52245604/…
– DebanjanB
Nov 19 at 11:22
I already checked that answer. That answer did not solve this issue. So, I try to solve it in a different way.
– Dipankar Nalui
Nov 19 at 12:45
add a comment |
Check this discussion stackoverflow.com/questions/52245604/…
– DebanjanB
Nov 19 at 11:22
I already checked that answer. That answer did not solve this issue. So, I try to solve it in a different way.
– Dipankar Nalui
Nov 19 at 12:45
Check this discussion stackoverflow.com/questions/52245604/…
– DebanjanB
Nov 19 at 11:22
Check this discussion stackoverflow.com/questions/52245604/…
– DebanjanB
Nov 19 at 11:22
I already checked that answer. That answer did not solve this issue. So, I try to solve it in a different way.
– Dipankar Nalui
Nov 19 at 12:45
I already checked that answer. That answer did not solve this issue. So, I try to solve it in a different way.
– Dipankar Nalui
Nov 19 at 12:45
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Those are chrome messages, so you need to set the options for the Chrome-Log Level to hide those messages, setting the log-level to --log-level=3
should be enough (only fatal log messages.
from selenium.webdriver.chrome.options import Options
[...]
chrome-options = Options()
chrome-options.add_argument("--log-level=3")
driver = webdriver.Chrome(chrome_options=chrome-options)
Also out of curiosity, might I ask why?
I already used this code. That message is still displayed. This does not solve my problem.
– Dipankar Nalui
Nov 19 at 10:49
I googled and found this same solution earlier. Many people suggested this solution in stackoverflow. But this did not solve my problem. So, I wanted to solve it in a different way.
– Dipankar Nalui
Nov 19 at 10:51
Thought that would help. btw I'd put the fact that you found a "solution" that worked for somebody else and that it did not work for you in the question with a link.
– Bernhard
Nov 19 at 12:01
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Those are chrome messages, so you need to set the options for the Chrome-Log Level to hide those messages, setting the log-level to --log-level=3
should be enough (only fatal log messages.
from selenium.webdriver.chrome.options import Options
[...]
chrome-options = Options()
chrome-options.add_argument("--log-level=3")
driver = webdriver.Chrome(chrome_options=chrome-options)
Also out of curiosity, might I ask why?
I already used this code. That message is still displayed. This does not solve my problem.
– Dipankar Nalui
Nov 19 at 10:49
I googled and found this same solution earlier. Many people suggested this solution in stackoverflow. But this did not solve my problem. So, I wanted to solve it in a different way.
– Dipankar Nalui
Nov 19 at 10:51
Thought that would help. btw I'd put the fact that you found a "solution" that worked for somebody else and that it did not work for you in the question with a link.
– Bernhard
Nov 19 at 12:01
add a comment |
up vote
0
down vote
Those are chrome messages, so you need to set the options for the Chrome-Log Level to hide those messages, setting the log-level to --log-level=3
should be enough (only fatal log messages.
from selenium.webdriver.chrome.options import Options
[...]
chrome-options = Options()
chrome-options.add_argument("--log-level=3")
driver = webdriver.Chrome(chrome_options=chrome-options)
Also out of curiosity, might I ask why?
I already used this code. That message is still displayed. This does not solve my problem.
– Dipankar Nalui
Nov 19 at 10:49
I googled and found this same solution earlier. Many people suggested this solution in stackoverflow. But this did not solve my problem. So, I wanted to solve it in a different way.
– Dipankar Nalui
Nov 19 at 10:51
Thought that would help. btw I'd put the fact that you found a "solution" that worked for somebody else and that it did not work for you in the question with a link.
– Bernhard
Nov 19 at 12:01
add a comment |
up vote
0
down vote
up vote
0
down vote
Those are chrome messages, so you need to set the options for the Chrome-Log Level to hide those messages, setting the log-level to --log-level=3
should be enough (only fatal log messages.
from selenium.webdriver.chrome.options import Options
[...]
chrome-options = Options()
chrome-options.add_argument("--log-level=3")
driver = webdriver.Chrome(chrome_options=chrome-options)
Also out of curiosity, might I ask why?
Those are chrome messages, so you need to set the options for the Chrome-Log Level to hide those messages, setting the log-level to --log-level=3
should be enough (only fatal log messages.
from selenium.webdriver.chrome.options import Options
[...]
chrome-options = Options()
chrome-options.add_argument("--log-level=3")
driver = webdriver.Chrome(chrome_options=chrome-options)
Also out of curiosity, might I ask why?
answered Nov 19 at 10:23
Bernhard
847115
847115
I already used this code. That message is still displayed. This does not solve my problem.
– Dipankar Nalui
Nov 19 at 10:49
I googled and found this same solution earlier. Many people suggested this solution in stackoverflow. But this did not solve my problem. So, I wanted to solve it in a different way.
– Dipankar Nalui
Nov 19 at 10:51
Thought that would help. btw I'd put the fact that you found a "solution" that worked for somebody else and that it did not work for you in the question with a link.
– Bernhard
Nov 19 at 12:01
add a comment |
I already used this code. That message is still displayed. This does not solve my problem.
– Dipankar Nalui
Nov 19 at 10:49
I googled and found this same solution earlier. Many people suggested this solution in stackoverflow. But this did not solve my problem. So, I wanted to solve it in a different way.
– Dipankar Nalui
Nov 19 at 10:51
Thought that would help. btw I'd put the fact that you found a "solution" that worked for somebody else and that it did not work for you in the question with a link.
– Bernhard
Nov 19 at 12:01
I already used this code. That message is still displayed. This does not solve my problem.
– Dipankar Nalui
Nov 19 at 10:49
I already used this code. That message is still displayed. This does not solve my problem.
– Dipankar Nalui
Nov 19 at 10:49
I googled and found this same solution earlier. Many people suggested this solution in stackoverflow. But this did not solve my problem. So, I wanted to solve it in a different way.
– Dipankar Nalui
Nov 19 at 10:51
I googled and found this same solution earlier. Many people suggested this solution in stackoverflow. But this did not solve my problem. So, I wanted to solve it in a different way.
– Dipankar Nalui
Nov 19 at 10:51
Thought that would help. btw I'd put the fact that you found a "solution" that worked for somebody else and that it did not work for you in the question with a link.
– Bernhard
Nov 19 at 12:01
Thought that would help. btw I'd put the fact that you found a "solution" that worked for somebody else and that it did not work for you in the question with a link.
– Bernhard
Nov 19 at 12:01
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53372520%2fpython-how-to-hide-output-message%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Check this discussion stackoverflow.com/questions/52245604/…
– DebanjanB
Nov 19 at 11:22
I already checked that answer. That answer did not solve this issue. So, I try to solve it in a different way.
– Dipankar Nalui
Nov 19 at 12:45