1
0
Fork 0
mirror of https://github.com/Nioux/AideDeJeu.git synced 2025-10-29 06:26:02 +00:00

Correctif xpath @class

This commit is contained in:
Yan Maniez 2018-04-29 13:58:23 +02:00
parent a75eaa90ef
commit fc19a60f70
2 changed files with 6 additions and 6 deletions

View file

@ -5,7 +5,7 @@
Title="{Binding Title}">
<ScrollView>
<StackLayout Orientation="Vertical" Padding="15">
<Label Text="{Binding Item.Title}" Style="{StaticResource Key=subsubsection}" />
<Label Text="{Binding Item.Name}" Style="{StaticResource Key=subsubsection}" />
<Label Text=" " />

View file

@ -36,19 +36,19 @@ namespace AideDeJeuLib.Monsters
public static Monster FromHtml(HtmlNode nodeMonster)
public static Monster FromHtml(HtmlNode divBloc)
{
var monster = new Monster();
var divMonster = nodeMonster.SelectSingleNode("div[@class='monstre']");
var divMonster = divBloc.SelectSingleNode("div[contains(@class,'monstre')]");
monster.Name = divMonster.SelectSingleNode("h1").InnerText;
monster.NameVO = divMonster.SelectSingleNode("div[@class='trad']/a").InnerText;
var divSansSerif = divMonster.SelectSingleNode("div[@class='sansSerif']");
monster.NameVO = divMonster.SelectSingleNode("div[contains(@class,'trad')]/a").InnerText;
var divSansSerif = divMonster.SelectSingleNode("div[contains(@class,'sansSerif')]");
var typeSizeAlignment = divSansSerif.SelectSingleNode("h2/em").InnerText;
var matchesTypeSizeAlignment = new Regex("(?<type>.*) de taille (?<size>.*), (?<alignment>.*)").Match(typeSizeAlignment);
monster.Type = matchesTypeSizeAlignment.Groups["type"].Value;
monster.Size = matchesTypeSizeAlignment.Groups["size"].Value;
monster.Alignment = matchesTypeSizeAlignment.Groups["alignment"].Value;
var divRed = divSansSerif.SelectSingleNode("div[@class='red']");
var divRed = divSansSerif.SelectSingleNode("div[contains(@class,'red')]");
monster.Strength = divRed.SelectSingleNode("strong").NextSibling.InnerText;
//monster.LevelType = nodeSpell.SelectSingleNode("h2/em").InnerText;
//monster.Level = spell.LevelType.Split(new string[] { " - " }, StringSplitOptions.None)[0].Split(' ')[1];