Closed nebudev14 closed 8 months ago
Thanks, looks like it's broken.
same here bro!
I guess "broken" isn't entirely accurate, since the code reads
# TODO: Parse the image
image = None
This would be a great first PR for a beginner!
I took a look at it and attempted a fix.
Looks like the first 10 images on each page are loaded into:
<span class="chart-element__image flex--no-shrink" style="background-image: url('https://charts-static.billboard.com/img/2020/02/jack-harlow-16c-whats-poppin-fly-53x53.jpg');"></span>
.
The rest of the equivalent spans come up as:
<span class="chart-element__image flex--no-shrink" style=""></span>
My guess is that the site is using javascript to add the 'background-image' style as the page loads.
If that's the case, the only fix would be to add something like selenium in specifically for the images.
Fixed here #80
I've Fixed it
on line 355 change this image = None to image = entrySoup.select_one("li:nth-child(2) img").get("data-lazy-src", None)
Happy Coding y'all
Thanks! Merged. The latest version (7.0.1) contains the fix.
Every time I try to use
song = chart[0] print(song.image)
It keeps returning None (for all songs). Is there any reason for this?