26 lines
843 B
C#
26 lines
843 B
C#
|
using HtmlAgilityPack;
|
||
|
using System;
|
||
|
using System.Linq;
|
||
|
|
||
|
class DrApi {
|
||
|
|
||
|
public static async Task<string> get_rants (string url) {
|
||
|
|
||
|
string response = await HTTP.get(url).ConfigureAwait(false);;
|
||
|
HtmlDocument doc = new HtmlDocument();
|
||
|
doc.LoadHtml(response);
|
||
|
var nodes = doc.DocumentNode.SelectNodes("//a");
|
||
|
//var nodes = doc.DocumentNode.SelectNodes("//a[contains(@class,'rantlist-content-col')");
|
||
|
//var nodes = doc.DocumentNode.SelectNodes("//div[contains(@class, 'rant-comment-row-widget')]");
|
||
|
foreach (var node in nodes) {
|
||
|
Console.WriteLine(node.GetAttributeValue("class","None"));
|
||
|
if(node.GetAttributeValue("class","None") == "rantlist-bglink"){
|
||
|
|
||
|
Console.WriteLine(node.InnerText);
|
||
|
}
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
}
|