Có cách nào để phân tích chuỗi HTML trong mã Net đằng sau như DOM phân tích cú pháp ...Parsing HTML Chuỗi
tức GetElementByTagName ("abc"). GetElementByTagName ("tag")
Tôi đã đoạn mã này ...
private void LoadProfilePage()
{
string sURL;
sURL = "http://www.abcd1234.com/abcd1234";
WebRequest wrGETURL;
wrGETURL = WebRequest.Create(sURL);
//WebProxy myProxy = new WebProxy("myproxy",80);
//myProxy.BypassProxyOnLocal = true;
//wrGETURL.Proxy = WebProxy.GetDefaultProxy();
Stream objStream;
objStream = wrGETURL.GetResponse().GetResponseStream();
if (objStream != null)
{
StreamReader objReader = new StreamReader(objStream);
string sLine = objReader.ReadToEnd();
if (String.IsNullOrEmpty(sLine) == false)
{
....
}
}
}
nếu nó là XHTML hợp lệ có lẽ bạn có thể tải nó trong 'System.Xml.XDocument' – Bazzz