TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Hailong Zhang
NA
6
524
A scraping issue on C# scraping project
Jun 30 2020 1:11 PM
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!!!
Reply
Answers (
2
)
Configure a timeout in web.config for a web service
Random exception on Web service call