Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from bs4 import BeautifulSoup
- import urllib.request
- import requests
- import random
- link = input("4chan thread: ")
- r = requests.get(link)
- soup = BeautifulSoup(r.content)
- c_data = soup.find_all("a", {"class": "fileThumb"})
- print("making a file?")
- for item in c_data:
- print(item.get("href"))
- image = item.get("href")
- url = "http:" + image
- name = random.randrange(1, 90000)
- full_name = str(name) + ".jpg"
- pic = urllib.request.urlretrieve(url, full_name)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement