반응형
xpath 문법으로 "//span[contains(text(), '찾을문구')]" 을 사용하면 됩니다.
from selenium import webdriver
from selenium.webdriver.common.by import By
from webdriver_manager.chrome import ChromeDriverManager
browser = webdriver.Chrome(ChromeDriverManager().install())
browser.get("https://target-site")
browser.find_element(By.XPATH, "//span[contains(text(), '찾을문구')]")
반응형