2

I was trying to simply open and close a website and get it's title using Python3 and Selenium.

My code-

from selenium import webdriver

PATH = "C:\Program Files (x86)\chromedriver.exe"
driver = webdriver.Chrome(PATH)

driver.get("https://www.techwithtim.net")
print(driver.title)
driver.close()

It runs successfully but does show these error/warning in the terminal

DevTools listening on ws://127.0.0.1:3040/devtools/browser/7d22edc8-0e93-4498-a836-55e560ffc60b
[65744:16912:0614/221655.716:ERROR:device_event_log_impl.cc(214)] [22:16:55.716] Bluetooth: bluetooth_adapter_winrt.cc:1072 Getting Default Adapter failed.
[65744:16912:0614/221655.772:ERROR:device_event_log_impl.cc(214)] [22:16:55.773] USB: usb_device_handle_win.cc:1058 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)

Can anybody please help? Note - I have installed python selenium module and chromewebdriver

  • 1
    If it "runs successfully" I am confused what you are trying to accomplish? just make the error go away? It is indeed quite a strange error message based on the code. – C. Peck Jun 14 '21 at 16:25
  • I know but still asking whether any solutions because I see in other's cases it doesn't throw this error – Md Atifuzzaman Jun 14 '21 at 16:28
  • You may want to check which versions you are running. https://stackoverflow.com/a/63270005 – Amos Baker Jun 14 '21 at 18:33
  • I am using Google Chrome-Version 91.0.4472.106 (Official Build) (64-bit) And Chrome Webdriver - 91.0.4472.19 Note I am using windows – Md Atifuzzaman Jun 15 '21 at 03:26

1 Answers1

0

Finally my issue is fixed.

Adding these changes fixed the issue and removed those warnings.

from selenium import webdriver

options = webdriver.ChromeOptions() 
options.add_experimental_option("excludeSwitches", ["enable-logging"])

PATH = "C:\Program Files (x86)\chromedriver.exe"
driver = webdriver.Chrome(options=options , executable_path=PATH)

driver.get("https://www.techwithtim.net")
print(driver.title)
driver.close()