Jump to content

GET Request from API on EAN13's


Firiyuu1

Recommended Posts

Hello, how do I get the ean13 via url request? because with the current python libraries, all the links and id's are gettable, here's my prior code:

 

api = PrestashopApi('http://www.example.com/api', '<token code here>')






#GET DATA FROM PRESTASHOP
print('Getting products from prestashop.... ')
res = api.get('products')
count = 0

for p in res['products']['product']:
    if count == 10000:
       break
    else:
       url = p['@xlink:href']
       r = PrestashopApi(url, '<token>')
       print(r)
       print('Success')

 

 

I can get the links from my shop with this, however how should I get the EAN13's? I tried doing all sort of things,

 

I tried various methods, ( dumping to json, scraping, xmltree, etc) either the response was empty or I get lots of errors.

I tried getting it from library by p['@ean13'] since it got the id via p['@id'] and the link via p['@xlink:href'] but im getting a keyerror.

I really need your help. Please.


   

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...