로딩
요청 처리 중입니다...

[Python] 유튜브 자동 검색

 [Python] 유튜브 자동 검색

s에 검색할 내용을 입력하면 자동으로 크롬을 실행해 유튜브에서 검색한다. from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium import webdriver import time s = "음악" options = webdriver.ChromeOptions() options.add_experimental_option("excludeSwitches", ["enable-logging"]) browser = webdriver.Chrome(options=options, executable_path=r'chromedriver.exe 경로') browser.get('https://www.youtube.com/') time.sleep(2) search = browser.find_element(By.XPATH, '//input[@id="search"]') searc...

# python # 파이썬