Skip to content
This repository has been archived by the owner on Jul 3, 2020. It is now read-only.

Commit

Permalink
Successfully Parsed Data from the Theater Schedule HTML.
Browse files Browse the repository at this point in the history
  • Loading branch information
bofirial committed Jun 10, 2017
1 parent 40122a1 commit 7d9442b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Melody49Notifier/DataAbstraction/TheaterScheduleHTMLParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Threading.Tasks;
using Melody49Notifier.Models;
using Microsoft.Azure.WebJobs.Host;
using HtmlAgilityPack;

namespace Melody49Notifier.DataAbstraction
{
Expand All @@ -19,7 +20,16 @@ public TheaterScheduleHTMLParser(TraceWriter log)

public TheaterSchedule ParseTheaterScheduleHTML(string html)
{
throw new NotImplementedException();
HtmlDocument htmlDocument = new HtmlDocument();
htmlDocument.LoadHtml(html);

TheaterSchedule theaterSchedule = new TheaterSchedule();

//theaterSchedule.ScheduleDescription = htmlDocument.DocumentNode.Descendants("div").Where(x => x?.Attributes?["id"]?.Value == "playweek").First().ChildNodes.First().InnerText;

theaterSchedule.ScheduleDescription = htmlDocument.DocumentNode.SelectNodes("//div[@id=\"playweek\"]/p").First().InnerText;

return theaterSchedule;
}
}
}
1 change: 1 addition & 0 deletions Melody49Notifier/Melody49Notifier.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<TargetFramework>net461</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="HtmlAgilityPack" Version="1.4.9.5" />
<PackageReference Include="Microsoft.Azure.WebJobs" Version="2.1.0-beta1" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions" Version="2.1.0-beta1" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Http" Version="1.0.0-beta1" />
Expand Down

0 comments on commit 7d9442b

Please sign in to comment.