---
# System prepended metadata

title: click youtube

---

# click youtube

```python=
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By


url='https://chuckchu.com.tw/article_list'


driver=webdriver.Chrome()
driver.get(url)


WebDriverWait(driver, 30).until(EC.presence_of_element_located((By.LINK_TEXT,'Youtube')))
elem = driver.find_element(By.XPATH, "//a[@href='article_list/video']")
elem.click()

WebDriverWait(driver, 30).until(EC.presence_of_element_located((By.CLASS_NAME,'text-wrapper')))
elem = driver.find_element(By.XPATH, "//a[@href='article/291']")
elem.click()

WebDriverWait(driver, 30).until(EC.presence_of_element_located((By.XPATH, "//iframe[1]")))
driver.switch_to.frame(driver.find_element(By.XPATH, "//iframe[1]"))

elem = driver.find_element(By.XPATH, "//div[@id='player']")
elem.click()
```