D
D
DavidJarr2018-08-25 19:22:11
.NET
DavidJarr, 2018-08-25 19:22:11

Parse desired C# AngleSharp tags?

Hello everyone, I use the AngleSharp parsing library, the img tag itself is easy to parse

var menuPics = document
              .All
              .Where(p => p.LocalName == "img")
              .ToArray();

But how do I parse all <img>the tags where the attribute srcends with _200x300.jpgand end up with everything that is in src?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
MIsternik, 2018-08-25
@DavidJarr

Something like this.
on and then get the attribute from the collection of attributes. There's nothing to explain

D
DarkByte2015, 2018-08-25
@DarkByte2015

I did not understand what kind of library, but something like this:

document.All.Where(p => p.LocalName == "img").OfType<Img>().Where(p => p.Src.EndsWith("_200x300.jpg")).Select(p => p.Src).ToArray()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question