I created a C# file to view the extracted information.
Listing 1:TaryaServiceCS File
<%@ Page Language="C#" Debug="true" %>
<script runat="Server">
void Page_Load()
{
TaryaService objTaryaService;
GetTaryaServicesMatches objMatches;
try
{
objTaryaService = new TaryaService();
objTaryaService.Timeout = 2000;
objMatches = objTaryaService.GetTaryaServices();
lblTitles.Text = objMatches.myServices[0];
}
catch (Exception e)
{
lblTitles.Text = e.Message;
}
}
</script>
<html>
<head>
<title>TestTaryaService.aspx</title>
</head>
<body>
<h3>
My Own Services</h3>
<font color="blue">
<asp:Label ID="lblTitles" runat="Server" />
</font>
</body>
</html>
We have a label in this file that shows the extracted information. On the Page Load event, we created TaryaService and the GetTaryaServicesMatches objects. objMatches is instantiated by calling GetTaryaServices on objTaryaService. Then we call the property myServices[0] on objMatches. Please note that we passed 0 as the argument to myServices. Here we are assuming we will get only one set of information.
In the following example, I replaced ul element with il:
<li>(.*?)li>
In this case, we might get six elements; then we might have iterated from 0 to 5. We wrapped our code in a try-catch block in case we encounter any issues. When you execute everything properly, you should be able to see this, which wraps up this code snippet. Thanks for reading!