WItam,
Potrzebuje pomocy w wyciagnieciu numerow telefonu oraz adres email z ponizszego zrodla strony:
<table border="0" cellpadding="0" cellspacing="0">
<tr valign="top" class="communication_tel">
<td class="t_label">Phone:</td><td> </td><td class="t_value">
+49 9522-7097540
</td></tr>
<tr valign="top" class="communication_fax">
<td class="t_label">Fax:</td><td> </td><td class="t_value">
+49 9522-7097534
</td></tr>
<tr valign="top" class="communication_email">
<td class="t_label">e-mail:</td><td> </td><td class="t_value">
<a href="mailto:[email protected]">[email protected]</a>
</td></tr>
<tr valign="top" class="communication_internet">
<td>Website:</td><td> </td><td class="t_value">
<a target="_blank" href="http://www.1a-abrasives.com">www.1a-abrasives.com</a>
</td></tr>
</table>
Dla przykladu chcialem wyciagnac Phone: Stworzylem program do tego ale output jest pusty:
static void Main(string[] args)
{
try
{
WebClient myWebClient = new WebClient();
string page = myWebClient.DownloadString("http://exhibitors.grindtec.de/en/exhibitors-products/exhibitors/exhibitors-details/ID/751702/action/detail/controller/Exhibitors/");
string name1 = "<td class=\"t_label\">Phone:</td><td> </td><td class=\"t_value\">(.*)</td></tr>";
Regex rgx = new Regex(name1);
MatchCollection matches = rgx.Matches(page);
foreach (Match match in matches)
{
var b = Regex.Match(match.Value, "(?<=>)(.*)(<=?)");
Console.WriteLine(b.Value);
}
}
catch (Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Console.ReadLine();
}
Czy ktos moze mi podpowiedziec co robie zle?