Missing methods in HtmlAgilityPack in a Xamarin.Forms project?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Missing methods in HtmlAgilityPack in a Xamarin.Forms project?



I installed the HtmlAgilityPack package in the portable project of a Xamarin app, but I found that SelectNodes method of the HtmlNode class is missing, so this code doesn't compile:


SelectNodes


HtmlNode


var htmlDoc = new HtmlDocument();
htmlDoc.LoadHtml(html);
var imgNodes = htmlDoc.DocumentNode.SelectNodes("//img")



because:



'HtmlNode' does not contain a definition for 'SelectNodes' and no
extension method 'SelectNodes' accepting a first argument of type
'HtmlNode' could be found (are you missing a using directive or an
assembly reference?)



I installed the same package on a console application (targets .NET Framework 4.7.1) and another cross platform app (targets .NET standard 2.0), they both have this method as expected.



this is the targeting list of the project causing the problem:



enter image description here





if you want to parse HTML try using AngleSharp
– Jason
Aug 12 at 15:17





Maybe it is not available in Core 1.0
– CodingYoshi
Aug 12 at 15:26


Core 1.0





@Jason I'm reading the documentation now, but find some troubles to figure out how to change certain attributes of an element (src attribute of img for example) and returning the modified document, is it possible with AngleSharp?
– mshwf
Aug 12 at 16:03





just select the element and then do element.SetAttribute, I believe
– Jason
Aug 12 at 16:09









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard