BeautifulSoup Showing none while extracting image url - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html) +--- Thread: BeautifulSoup Showing none while extracting image url (/thread-34962.html) |
BeautifulSoup Showing none while extracting image url - josephandrew - Sep-20-2021 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 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
|