Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SelectSingleNode() doesn't select <tr> #48

Open
ashahabov opened this issue Jun 7, 2024 · 0 comments
Open

SelectSingleNode() doesn't select <tr> #48

ashahabov opened this issue Jun 7, 2024 · 0 comments

Comments

@ashahabov
Copy link

ashahabov commented Jun 7, 2024

In the provided code snippet, the SelectSingleNode() method is expected to return an instance of INode for the selected <tr> element within the HTML content. However, the method is returning null, which indicates a potential bug in the library.

Repro

var context = BrowsingContext.New(Configuration.Default);
var parser = context.GetService<IHtmlParser>();
var document = await parser.ParseDocumentAsync("<table><tr></tr></table>");

var trNode = document.Body.SelectSingleNode("//table/tr");

Actual Result

trNode is null

Expected Result

trNode is not null

Environment

.csproj

<PropertyGroup>
  <TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
  <PackageReference Include="AngleSharp" Version="1.1.2" />
  <PackageReference Include="AngleSharp.XPath" Version="2.0.4" />
</ItemGroup>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant