英文:
My code at a list component and href link doesn´t work
问题
Here is the translated code part:
type <li data-id="rds">
<a href="/apps/rds/" tabindex="3">
<img class="app-icon" alt="" src="/apps/rds/img/research-white.svg">
<div class="icon-loading-dark" style="display:none;"></div>
<span>
RDS App </span>
</a>
</li>
driver.find_elements(By.LINK_TEXT, " RDS App ").click()
And the issue:
This Python-Code doesn't work!
He shows: driver.find_elements(By.LINK_TEXT, " RDS App ").click()
AttributeError: 'list' object has no attribute 'click'
Let me know if you need further assistance.
英文:
type <li data-id="rds">
<a href="/apps/rds/" tabindex="3">
<img class="app-icon" alt="" src="/apps/rds/img/research-white.svg">
<div class="icon-loading-dark" style="display:none;"></div>
<span>
RDS App </span>
</a>
</li>
type here
driver.find_elements(By.LINK_TEXT," RDS App ").click()
here
This Python-Code doesn´t work!
He shows: driver.find_elements(By.LINK_TEXT," RDS App ").click()
AttributeError: 'list' object has no attribute 'click'
I want to test the rds app Link!
答案1
得分: 1
Your result is a list
, which doesn't have the click method. Try grabbing the first element of the list with this: driver.find_elements(By.LINK_TEXT, " RDS App ")[0].click()
英文:
Your result is a list
, which doesn't have the click method. Try grabbing the first element of the list with this: driver.find_elements(By.LINK_TEXT," RDS App ")[0].click()
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论