Created
November 26, 2017 01:49
-
-
Save aipi/307100b135ee0dfd31aeb103ffb8674a to your computer and use it in GitHub Desktop.
example used in PI4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GetTopSitesListAditionalInformation(LogIntoAlexa): | |
def __init__(self): | |
super().__init__() | |
self.top_list = json.load(open('../data/data.json')) | |
self.url = 'https://www.alexa.com/siteinfo/' | |
def get_additional_informations(self): | |
self.log_into_alexa() | |
i = 0 | |
for key, value in self.top_list.items(): | |
i += 1 | |
print(i) | |
url = self.url + key | |
request = self.session_requests.get( | |
url, headers=dict(referer=url)) | |
soup = BeautifulSoup(request.text, "html.parser") | |
self.top_list[key]['audience_geography'] = \ | |
self.__get_audience_geography(soup) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment