I’m trying to Webscrape and retrieve a link from this website, [https://www.tradingpost.com.au/searchresults/?q=&filter-location-text=&filterlocation-dist=25&cat=] and print it using Selenium and C#. But I can’t get hold of the data because I’m not sure of which method to use.
Here is the snippet of html code from the website.
<a name="listing-39SH6B" href="/Real-Estate/Residential-For-Sale/2405-275-Wickham-Street-Fortitude-Valley-QLD-4006/Fortitude-Valley/QLD/AdNumber=39SH6B" class="thumbnail__link internal InStock" target="_blank"></a>
I’m trying to grab the href link above.
So far I’ve tried the methods listed below and they don’t seem to work.
string itemUrl = itemElement.FindElement(By.CssSelector(".href")).Text;
string itemUrl = itemElement.GetAttribute("href");
I’m new at this and any answers will be appreciated, thank you very much!
Lol Lel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.