If you look at the element, you will notice that the redirect URL exists ( data-ahref ), but it is encoded and decoded somewhere in the JS sources. Unfortunately, they are minimized and confusing, so finding a decoder function will be difficult. So you have two options:
Follow call forwarding
Here is what Roberval _T_ suggested in his answer: click on an item, wait a while for the page to load on another tab, take the URL. This is a completely correct answer, which, in my opinion, deserves to be improved, however here is a small technique that I always try when for some reason the data is not available:
Clear mobile web page
The obvious advantage of scraping mobile pages is that they are lighter than desktop pages. But often the mobile site also has data present when the desktop version tries to hide the data for some reason. In this case, all the information (address, homepage, phone) in the mobile version can be immediately captured without explicitly loading the URL. This is what the page looks like when I launch selenium using a mobile user agent:

Sample code using the IPhone user agent:
from selenium import webdriver from selenium.webdriver.chrome.options import Options url = 'https://www.tripadvisor.co.uk/Attraction_Review-g304551-d4590508-Reviews-Ashok_s_Taxi_Tours-New_Delhi_National_Capital_Territory_of_Delhi.html' chrome_options = Options() chrome_options.add_argument('--user-agent=Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) CriOS/56.0.2924.75 Mobile/14E5239e Safari/602.1') driver = webdriver.Chrome(chrome_options=chrome_options) driver.get(url) element = driver.find_element_by_css_selector('div.website.contact_link') link = element.text driver.quit() print(link)
hoefling
source share