Skip to content

Commit 3713fb1

Browse files
authored
Fix cannot use resource from hero inventory part 2 (#155)
Refactor the `IsInventoryPage` method in `InventoryParser.cs` to change the logic for selecting `<a>` nodes within the `heroDiv` element. Replaced the `GetAttributeValue` check for `data-tab` with a `HasClass` check for the `tabItem` class. This improves the clarity and maintainability of the node selection logic.
1 parent 53acb07 commit 3713fb1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

MainCore/Parsers/InventoryParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public static bool IsInventoryPage(HtmlDocument doc)
77
var heroDiv = doc.GetElementbyId("heroV2");
88
if (heroDiv is null) return false;
99
var aNode = heroDiv.Descendants("a")
10-
.FirstOrDefault(x => x.GetAttributeValue("data-tab", 0) == 1);
10+
.FirstOrDefault(x => x.HasClass("tabItem"));
1111
if (aNode is null) return false;
1212
return aNode.HasClass("active");
1313
}

0 commit comments

Comments
 (0)