I am trying to scrape images but they said me you you are probably treating a list of elements like a single element is there any solution for these the page link is https://www.etsy.com/search/handmade?q=marokaanse+azilal+vloerkleden&explicit=1&item_type=handmade&ship_to=NL&page=1&ref=pagination
from selenium import webdriver
from bs4 import BeautifulSoup
from time import sleep
import pandas as pd
import requests
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.3"
}
url = 'https://www.etsy.com/search/handmade?q=marokaanse+azilal+vloerkleden&explicit=1&item_type=handmade&ship_to=NL&page=1&ref=pagination'
# keeping it simple: download from https://chromedriver.chromium.org/downloads (match version of Chrome installed)
# put file in same folder as the script. Firefox driver is available if you search for it
driver = webdriver.Chrome("C:\Program Files (x86)\chromedriver.exe")
driver.get(url)
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.3"
}
productlinks=[]
soup = BeautifulSoup(driver.page_source, "html.parser")
tra = soup.select('div.js-merch-stash-check-listing')
for links in tra:
for link in links.find_all('a',href=True):
comp=link['href']
productlinks.append(comp)
for link in productlinks:
r =requests.get(link,headers=headers)
soup=BeautifulSoup(r.content, 'html.parser')
images=soup.select('div.carousel-pagination-item-v2 + div ul')
for image in images.find_all('img',src=True):
fiv=image['src']
print(fiv)