<table class="table"> <tr> <td class="frame"> <table class="frame" id="highlight"> <tr class="colhead"> <td id="categ_icon"> <a href="#" class="colhead">Category</a> </td> <td id="name"> <a href="?sort=name&h=2&d=ASC" class="colhead">Name</a> </td> <td id="links"> <a href="#" class="colhead">Links</a> </td> <td id="files"> <a href="?sort=numfiles&h=3&d=DESC" class="colhead">Files</a> </td> <td id="comments"> <a href="?sort=comments&h=4&d=DESC" class="colhead">Comm.</a> </td> <td id="added"> <a href="?sort=added&h=6&d=DESC" class="colhead">Added</a> </td> <td id="size"> <a href="?sort=size&h=8&d=DESC" class="colhead">Size</a> </td> <td id="snatch"> <a href="?sort=times_completed&h=9&d=DESC" class="colhead">Snatch</a> </td> <td id="seeders"> <a href="?sort=seeders&h=10&d=DESC" class="colhead">Seed</a> </td> <td id="leechers"> <a href="?sort=leechers&h=11&d=DESC" class="colhead">Leech</a> </td> </tr> <tr class="torrent_1"><td class="table_categ_icon"><a class="link" href="?cat=545" onmouseover="return overlib('Game of Thrones');" önmouseout="return nd();"><img src="http://static.freshon.tv/pic/catids/545.gif" width="80" height="44" alt="category_icon" /></a></td><td class="table_name"><div> <a <big>href="/details.php?id=108260"</big> class="torrent_name_link"title="Game.of.Thrones.S03E08.PROPER.HDTV.x264-2HD">Game.of.Thrones.S03E08.PROPER.HDTV.x264-2HD</a> </div> <div class="table_genre_nf"><a href="/browse.php?filter=drama" class="normal">Drama</a> | <a href="/browse.php?filter=family" class="normal">Family</a> | <a href="/browse.php?filter=fantasy" class="normal">Fantasy</a></div></td><td class="table_links"><a href="/download.php?id=108260&type=torrent" class="link"> <img src="http://static.freshon.tv/pic/download_12.png" alt="DW" onmouseover="return overlib('Download torrent');" önmouseout="return nd();" width="12" height="12"/> </a><a href="/bookmarks.php?type=add&tid=108260" class="link"> <img src="http://static.freshon.tv/pic/bookmark_add_12.png" alt="BK_add" onmouseover="return overlib('Bookmark torrent');" önmouseout="return nd();" width="12" height="12"/> </a></td><td class="table_files"> <a href="/details.php?id=108260&files=1#files_tab" class="link"> 2 </a> </td><td class="table_comments"> <a href="details.php?id=108260&page=0#comments_tab" class="link"> 0 </a>
public string GetLinkOfNews(string xpath) { string content = GoToBrowseWebsite("http://abc.com"); string htmldoc = ""; HtmlAgilityPack.HtmlDocument document = new HtmlAgilityPack.HtmlDocument(); document.LoadHtml(content); HtmlNodeCollection nodeCollection = document.DocumentNode.SelectNodes(xpath); foreach (HtmlNode node in nodeCollection) { htmldoc += node.ToString(); } return htmldoc; }
public string GoToBrowseWebsite(string url) { HttpWebRequest requestBR = (HttpWebRequest)WebRequest.Create(url); requestBR.Method = "GET"; requestBR.ContentType = "application/x-www-form-urlencoded"; requestBR.CookieContainer = ReadCookiesFromDisk("E:\\cookie.txt"); HttpWebResponse responseBR = (HttpWebResponse)requestBR.GetResponse(); StreamReader reader = new StreamReader(responseBR.GetResponseStream()); string htmldoc = reader.ReadToEnd(); responseBR.Close(); return htmldoc; }
/table/tr/td/div/a[@href]
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)