I'm trying to learn to do Web Scraping, I've already managed to get all the data except one, the src attribute of an image (img), the funny thing is that if I get the alt.
A fragment of the example website:
<li>
<a href="/ver/49688/steinsgate-0-15" class="fa-play">
<span class="Image"><img src="/uploads/animes/thumbs/2950.jpg" alt="Steins;Gate 0"></span>
<span class="Capi">Episodio 15</span>
<strong class="Title">Steins;Gate 0</strong>
</a>
</li>
The fragment of code that does not work:
using System.Net.Http;
using HtmlAgilityPack;
var Ultimo_animes = Ultimos_Episodios[0].Descendants("li")
.Where(node => node.GetAttributeValue("", "")
.Equals("")).ToList();
foreach (var Ultimo_anime in Ultimo_animes)
{
//Imagen
Console.WriteLine("Caratula: " + Ultimo_anime.Descendants("img")
.FirstOrDefault().GetAttributeValue("src", ""));
}
If I change:
GetAttributeValue("src", "")
By:
GetAttributeValue("alt", "")
If you take out: Steins; Gate 0
But with src, it comes out empty
A help please?
Thank you very much in advance and greetings