Answer the question
In order to leave comments, you need to log in
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
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question