I have a csv of a series of contacts from Salesforce with the name, location and a URL that opens an image which I need to download
Thus far I have only been able to access my Salesforce instance using Python but am struggling to find a means of using a python package to not only open the URL, but also download the image in .jpg format and rename it with the name and location of the client.
Is there any package available that would allow my to do this. I've tried using simple-salesforce
but I don't think it has this capability.
Below is the code i have so far showing a query that returns all the contacts that I need to download the URL link for (URL_Fotograf_a_Cliente__c
), but I haven't got any further than that
from simple_salesforce import Salesforce, SFType, SalesforceLogin
import pandas as pd
import json
from pprint import pprint as pp
session_id, instance = SalesforceLogin(username= username, password=password, security_token=security_token, sandbox=False)
print(session_id,instance)
sf = Salesforce(instance= instance, session_id=session_id)
SOQL= "SELECT Id, Name,C_digo_del_Usuario__c,Tratamiento_IPA__c,Estado__c,Municipio__c,Comunidad__c, URL_Fotograf_a_Cliente__c FROM Contact WHERE Tratamiento_IPA__c IN ('x', 'y', 'z')"
pp(sf.query(query = SOQL))