我在从所选照片中提取标签时遇到问题
我现在工作的代码是
<a class=" abcd" href="/explore/tags/ht1/" tabindex="0">#ht1</a>
<a class=" abcd" href="/explore/tags/ht2/" tabindex="0">#ht2</a>
<a class=" abcd" href="/explore/tags/ht3/" tabindex="0">#ht3</a>
<a class=" abcd" href="/explore/tags/ht4/" tabindex="0">#ht4</a>
所以我需要把它们放在一个列表上,所以我写
tags = driver.find_elements_by_class_name('abcd')
这样就行了,我可以打印列表并检查Ht的确切数量
但当我这么做的时候
tags[0].text
只执行一条白线,我需要打印“#ht1” 我用其他单一类测试了这一点,结果成功了,我认为问题在于打印列表
您可能需要等待页面加载和元素变得可见
取代
进口
相关问题 更多 >
编程相关推荐