I wish everybody has a good day! I am new to building scraping project in c#. Now I am trying to scrape the content of a tag href property from a web-site. but could not come to good conclusion yet! Here is the structure of web-page:
- <table class="matches date_matches grouped">
- <thead>
- </thead>
- <tbody>
- <tr id="date_matches-16-53658" class="group-head clickable" stage-value="212">
- <th colspan="5"> </th>
- <th class="competition-link">
- <a href="/national/south-africa/psl/20192020/regular-season/r53038/"><span>More…</span></a>
- </th> </tr>
- <tr id="xxx"> ... </tr>
- </tbody>
- </table>
I am going to scrape the content of href url-link string (Here: "/national/south-africa/psl/20192020/regular-season/r53038/").
Here is my c# scraping project:
- using OpenQA.Selenium;
- using OpenQA.Selenium.Chrome;
- ...
- IWebDriver driver = new ChromeDriver();
- driver.Navigate().GoToUrl("https://...."); ReadOnlyCollection<IWebElement>
- alinks = driver.FindElements(By.XPath("//td[@class='score-time']/a[contains(@href, 'south-africa')]"));
I tried in some other ways for scraping the content of href property.
but still not get the correct result. Thanks in good advice!!!