Skip to content

Instantly share code, notes, and snippets.

@chiguniiita
Created July 22, 2016 23:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chiguniiita/8a9d059c68ed218bd3b3f4e506d4d753 to your computer and use it in GitHub Desktop.
Save chiguniiita/8a9d059c68ed218bd3b3f4e506d4d753 to your computer and use it in GitHub Desktop.
de:code2016 のセッション動画URL一覧
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