0

I'm executing a Selenium script written in Python with ChromeDriver 2.43 in Windows 10

Here is my code:

from selenium import webdriver
import os

chromedriver_path="C:\\Users\\user1\\Scripts\\chromedriver.exe"
os.environ["webdriver.chrome.driver"] = chromedriver_path
driver=webdriver.Chrome(chromedriver_path)
driver.get("https://stackoverflow.com")

Output:

C:\Users\user1\scripts>python test.py
[5632:15724:1114/172253.045:ERROR:install_util.cc(691)] Failed to read HKLM\SOFTWARE\Policies\Google\Chrome\MachineLevelUserCloudPolicyEnrollmentToken: The system cannot find the file specified. (0x2)

DevTools listening on ws://127.0.0.1:56320/devtools/browser/83af4222-f6f2-47ea-939c-f9818c5ff3c5

How to hide this error in output?

Dipankar Nalui
  • 1,121
  • 5
  • 18
  • 33
  • 1
    Check this discussion https://stackoverflow.com/questions/52401561/failed-to-read-hklm-software-policies-google-chrome-machinelevelusercloudpolicye – undetected Selenium Nov 14 '18 at 12:06
  • I'm using chrome browser Version 70.0.3538.102 (Official Build) (64-bit) – Dipankar Nalui Nov 14 '18 at 12:11
  • In Python, using `try, except` can we suppress/hide the error message ? – Dipankar Nalui Nov 14 '18 at 12:23
  • I don't feel you can proceed with this exception. Go through the discussion which covers three different approach for the solution. Perhaps there wasn't a canonical solution available. Different solution worked for different usecases. – undetected Selenium Nov 14 '18 at 12:28
  • It works fine when I added the string `MachineLevelUserCloudPolicyEnrollmentToken' using `regedit` in this path Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome – Dipankar Nalui Nov 14 '18 at 12:40
  • That error message with `Failed to read` was removed after editing the registry. – Dipankar Nalui Nov 14 '18 at 12:42
  • But how to remove the message `DevTools listening on ws://127.0.0.1:58802/devtools/browser/df52e552-e301-499a-84ed-21d0553ba46e` ? – Dipankar Nalui Nov 14 '18 at 12:43
  • This question was related to this error only, right? If your requirement have changed feel free to raise a new question as per your new requirement. Stackoverflow contributors will be happy to help you out. – undetected Selenium Nov 14 '18 at 12:45

0 Answers0