Re: [問題] Python+Selenium找到標籤裡的標籤

作者: dreambegins (⊙_⊙)   2023-07-20 14:24:10
305張應該是動態產生的tag 試著用CSS_SECECTOR丟參數進去試試看
舉例
Button = driver.find_element(By.CSS_SELECTOR, "li.albumlist-photo-item")
actions = ActionChains(driver)
actions.move_to_element(Button).click().perform()
time.sleep(3)
試試
※ 引述《EijiHoba (我要好工作)》之銘言:
: ※ [本文轉錄自 Python 看板 #1ak9dUDJ ]
: 作者: EijiHoba (我要好工作) 看板: Python
: 標題: [問題] Selenium找到標籤裡的標籤
: 時間: Thu Jul 20 10:20:10 2023
: <article id="albumlist-content">
: <ul class="albumlist-photo-list">
: <li class="albumlist-photo-item">
: <a class="albumlist-photo-thumb" href="/photo/s770187/18555098">
: <img rc="https://photo.abcde.net/s770187/1b145d3/18555098/1022075897_Q.jpg">
: </a>
: <a class="albumlist-photo-name" href="/photo/s770187/18555098">美女</a>
: <time>2014-08-04</time>
: <p>共305張</p>
: </li>
: 我想找到<p>共305張</p>這個標籤取得相簿張數
: 沒有ID 沒有Name 沒有 CSS Class
: 請問各位遇到這種情況如何找到

Links booklink

Contact Us: admin [ a t ] ucptt.com