I implement some IMDb scraper but my scraper gets the wrong image src value. Images are not loaded immediately and the value in src is some default image, it is not the picture of the movie because the page isn't loaded yet. How can I get the correct value from the src tag?
This is my code:
private IDocument GetMovies(int number)
{
var document = _context
.OpenAsync($"https://www.imdb.com/search/title/?groups=top_1000&sort=user_rating,desc&count={number}&start=201&ref_=adv_nxt").GetAwaiter().GetResult();
return document;
}
Here I get the values of the images:
var images = document.QuerySelectorAll("img").Select(x => x.GetAttribute("src"));