better error message

This commit is contained in:
Mylloon 2021-08-23 12:28:44 +02:00
parent a4772a94c6
commit 6e1b143cb6

View file

@ -16,8 +16,8 @@ class Scraper:
"redirect": "index.php"
}
def errorFormat(self, code: int) -> str:
return f"\Error: [{code}]"
def errorFormat(self, code: int, message: str = "") -> str:
return f"\Error: [{code}]{' ' if len(message) > 0 else ''}{message}"
def connect(self):
session = create_scraper(browser = {"browser": "chrome", "platform": "windows"})
@ -38,13 +38,12 @@ class Scraper:
return session
def search(self, session):
link = "No link for your application was found."
return link
def work(self):
session = self.connect()
link = self.search(session)
return link