Sep-20-2021, 11:40 AM
(This post was last modified: Sep-21-2021, 05:01 PM by josephandrew.)
Hello Everyone!
I am trying to extract images url from gallery images on woocommerce website, but its showing none when I tried through csv file. Also I want extract variation color. Here is my code
I am trying to extract images url from gallery images on woocommerce website, but its showing none when I tried through csv file. Also I want extract variation color. Here is my code
import csv from bs4 import BeautifulSoup import requests from urllib.request import urlretrieve import os import urllib import pandas as pd data_dic = {} with open('D:/Scrapping/Newfolder/Urls.csv') as csvFile: data = csv.DictReader(csvFile) for row in data: request = requests.get(row['url']) soup = BeautifulSoup(request.content, 'html.parser') print(soup.prettify) for images in soup.find_all('div', {'class': 'woocommerce-product-gallery__image'}): print(images.find('a')['href'])here is output
Output: PS D:\Scrapping> d:; cd 'd:\Scrapping'; & 'C:\Users\Asim\AppData\Local\Programs\Python\Python39\python.exe' 'c:\Users\Asim\.vscode\extensions\ms-python.python-2021.9.1230869389\pythonFiles\lib\python\debugpy\launcher' '59785' '--' 'd:\Scrapping\ztest.py'
PS D:\Scrapping>
Larz60+ write Sep-20-2021, 12:24 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use bbcode tags on future posts.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use bbcode tags on future posts.