Answer the question
In order to leave comments, you need to log in
How to put all strings in one list?
Greetings, there is a photo url parser, but they are all written as separate lines
import requests
from bs4 import BeautifulSoup
import urllib.request
import random
from time import sleep
url = "https://www.creativeshrimp.com/top-30-artworks-of-beeple.html"
source_code = requests.get(url)
plain_text = source_code.text
soup = BeautifulSoup(plain_text)
for link in soup.find_all("a",{"class":"lightbox"}):
href = link.get('href')
print(href)
img_name = random.randrange(1,10)
full_name = str(img_name) + ".jpg"
sleep(0.2)
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