Below is the source to download the images from any site.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import urllib3 | |
from bs4 import BeautifulSoup | |
html=requests.get('http://wallpaperswide.com/jessica_alba-desktop-wallpapers.html') | |
soup=BeautifulSoup(html.content) | |
images=[img for img in soup.find_all("img")] | |
print (images) | |
print ("Downloading the images from the site") | |
path=str(input("Please enter the path where you want to download")) | |
print (path) | |
path1=path.replace("\\","\\\\") | |
images_link=[each.get("src") for each in images] | |
print (images_link) | |
val=1 | |
for each in images_link: | |
filename=each.split('/')[-1] | |
print("path1"+path1) | |
fullpath=path1 + "\\\\" +filename | |
print("fullpath"+fullpath) | |
response=requests.get(each) | |
if response.status_code==200: | |
f=open(fullpath,'wb') | |
f.write(response.content) | |
f.close() | |
print("file have been saved") |
Casino site ᐉ VIRGINIA 100% Deposit Match Bonus up to
ReplyDeleteOnline casinos accept players luckyclub.live from countries around the world. These online casinos accept players from Asia and beyond. No deposit free spins. Casino