파이썬(Python)/웹스크롤링

[Python]Selenium BluetoothAvailability()에러 해결 방법 (usb_device_handle_win)

끄적끄적아무거나 2022. 1. 24. 08:50
반응형

 

목차

     

     

     

    [Python]Selenium BluetoothAvailability() 문제 현상

    코드>>

    from selenium import webdriver
    
    driver = webdriver.Chrome()
    driver.maximize_window()
    driver.get('http://www.g2b.go.kr/index.jsp')

     

    위 코드를 구현 하였고 아래와 같이 에러 메세지가 발생하였습니다.

     

    에러메세지>>

    [3740:8148:0124/084133.199:ERROR:chrome_browser_main_extra_parts_metrics.cc(227)] START: ReportBluetoothAvailability(). If you don't see the END: message, this is crbug.com/1216328.
    [3740:8148:0124/084133.200:ERROR:chrome_browser_main_extra_parts_metrics.cc(230)] END: ReportBluetoothAvailability()
    [3740:8148:0124/084133.200:ERROR:chrome_browser_main_extra_parts_metrics.cc(235)] START: GetDefaultBrowser(). If you don't see the END: message, this is crbug.com/1216328.
    [3740:16792:0124/084133.206:ERROR:device_event_log_impl.cc(214)] [08:41:33.206] USB: usb_device_handle_win.cc:1050 Failed to read descriptor from node connection: 시스템에 부착된 장치가 작동하지 않습니다. (0x1F)
    [3740:16792:0124/084133.208:ERROR:device_event_log_impl.cc(214)] [08:41:33.208] USB: usb_device_handle_win.cc:1050 Failed to read descriptor from node connection: 시스템에 부착된 장치가 작동하지 않습니다. (0x1F)
    [3740:16792:0124/084133.208:ERROR:device_event_log_impl.cc(214)] [08:41:33.208] USB: usb_device_handle_win.cc:1050 Failed to read descriptor from node connection: 시스템에 부착된 장치가 작동하지 않습니다. (0x1F)
    [3740:8148:0124/084133.226:ERROR:chrome_browser_main_extra_parts_metrics.cc(239)] END: GetDefaultBrowser()

     

     

    [Python]Selenium BluetoothAvailability() 해결 방법

    해당 에러 메세지는 블루투스 관련 연결에 대한 에러 메세지로 셀레니움을 사용해서 웹 크롤링(Web Crawling)과는 관련이 없습니다. 

    사실 에러 메세지가 나와도 사용에는 문제가 없지만 에러 메세지를 삭제하고 싶다면 아래와 같이 입력 하시면 됩니다.

     

    수정 코드>>

    from selenium import webdriver
    
    options = webdriver.ChromeOptions()
    options.add_experimental_option('excludeSwitches', ['enable-logging'])
    driver = webdriver.Chrome(options=options)
    
    driver.maximize_window()
    driver.get('http://www.g2b.go.kr/index.jsp')

    2~3번 라인: option을 사용해서 외부 스위치를 exclude 합니다.

    4번 라인:option이 포함된 drive를 실행합니다.

     

     

    반응형