I use code to get HTML source of a url , but there is a problem!!!
-
I use the following code to get HTML source of a url , but there is a problem!!!
public string Gethtmlsourcecode(string url)
{
WebResponse response = null;
WebRequest request = WebRequest.Create(url);
response = request.GetResponse();
string data = "";
if ((response is HttpWebResponse && ((HttpWebResponse)response).StatusCode.ToString() == "OK") ||
response is FileWebResponse)
{
StreamReader sr = new StreamReader(response.GetResponseStream());data = sr.ReadToEnd(); } return data; }
whith this code for url : http://sme.ir/?p=product.profile&ProductID=53834[^] part of data which is an html source of the url should be
<tr>
<td class="l lf" width="35%">نام:</td>
<td class="r rf">
آماده سازی و بسته بندی قهوه-كاكائو-چای كیسه ای
</td>
</tr>
<tr>
<td class="l lf">نام قانونی:</td>
<td class="r rf">
<a href='http://parstalat.sme.ir'>پارس طلعت</a>
</td>
</tr>but data is
<tr>
<td class="l lf" width="35%">نام:</td>
<td class="r rf"></td> </tr> <tr> <td class="l lf">نام قانونی:</td> <td class="r rf"> <a href='http://.sme.ir'></a> </td> </tr>
you can see some part of HTML source code is not in data!! what should i do to solve this problem?!!!