【发布时间】:2021-06-19 04:51:17
【问题描述】:
目前正在尝试使用 selenium 获取存储在此类中的数据并将其打印到控制台中。
<h3 class="tiktok-dvof16-AuthorTitle e10yw27c0">allawi_9</h3>
我试过 print(driver.find_elements_by_class_name("tiktok-1i51bth-AuthorAnchor e10yw27c1"))
【问题讨论】:
目前正在尝试使用 selenium 获取存储在此类中的数据并将其打印到控制台中。
<h3 class="tiktok-dvof16-AuthorTitle e10yw27c0">allawi_9</h3>
我试过 print(driver.find_elements_by_class_name("tiktok-1i51bth-AuthorAnchor e10yw27c1"))
【问题讨论】:
print(driver.find_elements_by_class_name("tiktok-1i51bth-AuthorAnchor").text)
【讨论】:
list object has no attribute text 另外,当最后不使用.text 时,这只会返回一个空列表。