I have a method called getsomething(url)
which hits a url and gets some details. This method returns a dictionary. Now as the url changes I want this dictionary which is already created to get updated with new items. How can this be done?
I have tried this:
url_list = ['http:something.com','anotherthing.com']
def getdetails(url):
dict = {}
# some lines of code here...
return dict
it is getting called here:
for url in url_list:
result = {}
result = result.update(getdetails(url))
I am getting error like nonetype object is not iterable
I need the result of both the url in same dict