Search code examples
python-2.7magento-1.3

How i do fetch list of website from magento using python code?


In this question fetch website list from magento using python.
In python code i have used xmlrpc,

I have already try this but error was occured my code is write below

result1=api.call('ol_websites.info',[1,])
print result1

How i do this, anyone can help me to solve this problem ?


Solution

  • from magento.api import API
    with API('url of magento instance',
                                'username',
                               'password') as api:
    
    websites = api.call('ol_websites.list', [])
    print "websites :",websites