Skip to content

Instantly share code, notes, and snippets.

Created October 19, 2015 12:07
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
static public async Task<string> GetBathDate(string screenName)
// ユーザープロフィールページの HTML 取得
string html;
using (var client = new WebClient() { Encoding = Encoding.UTF8 })
html = await client.DownloadStringTaskAsync("" + screenName);
// <span class="ProfileHeaderCard-birthdateText u-dir" dir="ltr"> 直下の <span> のテキスト値取得
var doc = new HtmlAgilityPack.HtmlDocument();
var spans = doc.DocumentNode.SelectNodes(@"//span[@class=""ProfileHeaderCard-birthdateText u-dir""]/span");
return spans?.First().InnerText;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment