finished webscrapper

This commit is contained in:
janis
2022-05-02 16:44:38 +02:00
parent be2b059b1d
commit f03927fda8

View File

@@ -10,27 +10,33 @@ class TopGamesUpdater:
self.__output = ""
self.__source = ""
self.__go = 1
self.__location = 0
self.err = ""
self.__return_value = []
def updater(self):
self.__get_source = bin.lib.website_source_grabber.WebsiteSourceGrabber().grabber()
print("ok")
self.__source = bin.lib.website_source_grabber.WebsiteSourceGrabber().grabber()
self.list_generator()
# while self.__go == 1:
# self.list_generator()
def list_generator(self):
self.__source = self.__get_source[self.__index + 100:]
while self.__go == 1:
try:
self.__index = self.__source.index("<div class=\"col search_name ellipsis\">")
self.__extracted = self.__source[self.__index + 80:self.__index + 200]
self.__index = self.__source[self.__location:].index("<div class=\"col search_name ellipsis\">")
self.__index += 80
self.__location += self.__index
self.__extracted = self.__source[self.__location:self.__location + 120]
self.__output = ""
for self.letter in self.__extracted:
if self.letter == "<":
break
else:
self.__output += self.letter
print(self.__output)
self.__return_value.append(self.__output)
except ValueError:
self.__go = 0
return self.__return_value
TopGamesUpdater().updater()