D
D
dolboed13242021-12-27 12:19:51
Python
dolboed1324, 2021-12-27 12:19:51

The first 5 links are parsed normally, after that the decode goes to base 64, what's wrong?

import requests
from bs4 import BeautifulSoup
import urllib.request

url = 'https://dota2.fandom.com/wiki/Category:Hero_icons'
respounse = requests.get(url)
soup = BeautifulSoup(respounse.content, "html.parser")
images = soup.find_all("img")
number = 0


for image in images:
    image_src = image["src"]
    print(image_src)
    urllib.request.urlretrieve(image_src, str(number))
    number += 1


here is the result
61c984c885ddf399853184.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
galaxy, 2021-12-27
@galaxy

data: URL

S
soremix, 2021-12-27
@SoreMix

This is an ordinary placeholder for some sort of lesiland. Look at the tag <img>, there is usually some kind of src for the full size of the image

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question