I am supposed to create script in Python for saving the views from varioues wiki pages formattes almost like Python dictionary
I use this code:
from urllib2 import urlopen as uReq
from bs4 import BeautifulSoup as soup
expURL = 'https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/en.wikipedia/all-access/all-agents/Albert_Einstein/daily/2015100100/2015100100'
uClient = uReq(expURL)
page = uClient.read()
uClient.close()
But it turns the text into a big array and I cannot work with it like a dictionary anymore. When I copy-paste the data into my code, it works as I would like it to work. Is there any possible function or way to keep the data as it is without turning it into an array?
Any help is much appreciated!