V
V
Valery Orlov2019-10-27 18:11:14
Python
Valery Orlov, 2019-10-27 18:11:14

How to follow href link using Selenium?

Good day.
The page has the following html code:

<div>
<div class="row">
<div class="col-12 col-md-9"><h3>Встречи</h3></div> 
<div class="col-12 col-md-3">
<a href="javascript:void(0)" class="card-header-link float-md-right">Обновить</a>
</div></div></div>

<div class="row">
<div class="col-12 col-md-9"><h3>Заметки</h3></div> 
<div class="col-12 col-md-3">
<a href="javascript:void(0)" class="card-header-link float-md-right">Обновить</a>
</div></div></div>

<div class="row">
<div class="col-12 col-md-9"><h3>О себе</h3></div> 
<div class="col-12 col-md-3">
<a href="javascript:void(0)" class="card-header-link float-md-right">Обновить</a>
</div></div></div>
</div>

How to click on a link in the "About me" block using Selenium?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
1
1001001, 2019-10-27
@lungdesire29

driver.find_element(By.XPATH, "//h3[contains(text(),'О себе')]//..//a").click()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question