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