---
# System prepended metadata

title: Selenium find element and click

---

# Selenium find element and click

```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://www.rakuten.com.tw/shop/uniqueoutlet/product/t57rgp4n5/?l-id=tw_search_product_thumbnail_1'


driver=webdriver.Chrome(executable_path=r'/usr/local/bin/chromedriver')

driver.get(url)


WebDriverWait(driver, 30).until(EC.presence_of_element_located((By.ID, 'item-purchase-cta')))

elem = driver.find_element(By.XPATH, "//*[text()='PS5光碟版主機 現貨']")
elem.click()


```