367 votes
0 answers
shopify - How can I upload a image from a src into and excel file in Python?
I am trying to fill an excel sheet with images (jpeg). For these images I have a list of src's that were retireved from the Shopify API. I am wondering how I can extract these images from the src and place them in a dataframe and then upload to excel.
productDF = pd.DataFrame(columns=('ProductID','Title','Store Image'))
count = 0
for prod in all_products['products']:
try:
productDF.loc[count] = (prod['id'], prod['title'],prod['images'][0]['src'])
except:
productDF.loc[count] = (prod['id'], prod['title'],"no image")
count+=1
productDF.to_excel('products.xlsx')
This is my for loop which gets the src for each product, but I need some help working out how I would get the actual image.
Undefined asked
Source
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.