Answer the question
In order to leave comments, you need to log in
How to get url after click on object with onclick in Selenium?
Hello!
There are sites that don't have explicit links in the HTML body. I came across these links:
<div onclick="openBook(2389);">
</div>
Answer the question
In order to leave comments, you need to log in
Algorithm:
1. Find all elements with onclick on the page (if the majority of the site has such a structure)
Example
2. Get the ID from the content of the onclick attribute (i.e. 2389 from openBook(2389);)
3. Blind from a piece of link and ID a full-fledged link and add it to the array of final links
currrent_link = "sit.com/book.php?id=" + current_id
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question