E
E
Evgeny_A2019-10-17 19:28:56
Python
Evgeny_A, 2019-10-17 19:28:56

How to get a browser rendered relative link in selenium?

Greetings.
Often relative links appear on the page, like this: If you just parse such a tag through Selenium, and then glue it with the domain:
<a href="Ford/Mustang"></a>

url = 'https://site.com/Car/Ford'
tag_a = 'Ford/Mustang'
new_url = urlparse(url).netloc + '/' + tag_a

Then it will turn out like this:
https://site.com/Ford/Mustang
And if you open the page in the browser ( https://site.com/Car/Ford) and hover over the link, then the browser will show another link in the lower left corner:
https://site.com/Car/Ford/Ford-Mustang
How does the browser understand that the Car should also get into URL? How to pull out from Selenium not the link that is inside, but the one that appears when you hover the cursor?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question