Created
July 22, 2016 23:07
-
-
Save chiguniiita/8a9d059c68ed218bd3b3f4e506d4d753 to your computer and use it in GitHub Desktop.
de:code2016 のセッション動画URL一覧
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using HtmlAgilityPack; | |
using System; | |
using System.Linq; | |
using System.Net; | |
using System.Web; | |
namespace ConsoleApplication | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var pageUrl = "https://channel9.msdn.com/Events/de-code/2016?sort=status&direction=asc#tab_sortBy_status"; | |
var web = new HtmlWeb(); | |
var htmldoc = web.Load(pageUrl); | |
foreach (var meta in htmldoc.DocumentNode.SelectNodes("//div[@class=\"entry-meta\"]")) | |
{ | |
var title = meta.SelectNodes(".//a[@class=\"title\"]").First().InnerText; | |
title = HttpUtility.HtmlDecode(title); | |
var anchor = meta.SelectNodes(".//ul[@class=\"downloads\"]//a").Where(d => d.InnerText.ToUpper() == "MP4").First(); | |
var url = anchor.Attributes["href"].Value; | |
Console.WriteLine(title); | |
Console.WriteLine(url); | |
Console.WriteLine(""); | |
} | |
Console.ReadKey(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment