Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib.request as urllibR
- import bs4
- url = "https://www.dmi.dk/lokation/show/DK/2624652/Aarhus/"
- dmi = urllibR.urlopen(url)
- dmiBS = bs4.BeautifulSoup(dmi.read(), "lxml")
- images = []
- for link in dmiBS.find_all("img"):
- images.append(link.get("src"))
- billed = "jeg fandt ikke noget :("
- for img in images:
- print(img)
- if "Russel_gletsjeren_i_2010_TN.jpg" in img:
- billed = img
- if billed != "jeg fandt ikke noget :(":
- urllibR.urlretrieve("https://www.dmi.dk/"+billed, "Vejr.png")
- print(billed)
Add Comment
Please, Sign In to add comment