better error message
This commit is contained in:
parent
a4772a94c6
commit
6e1b143cb6
1 changed files with 3 additions and 4 deletions
7
main.py
7
main.py
|
@ -16,8 +16,8 @@ class Scraper:
|
||||||
"redirect": "index.php"
|
"redirect": "index.php"
|
||||||
}
|
}
|
||||||
|
|
||||||
def errorFormat(self, code: int) -> str:
|
def errorFormat(self, code: int, message: str = "") -> str:
|
||||||
return f"\Error: [{code}]"
|
return f"\Error: [{code}]{' ' if len(message) > 0 else ''}{message}"
|
||||||
|
|
||||||
def connect(self):
|
def connect(self):
|
||||||
session = create_scraper(browser = {"browser": "chrome", "platform": "windows"})
|
session = create_scraper(browser = {"browser": "chrome", "platform": "windows"})
|
||||||
|
@ -38,13 +38,12 @@ class Scraper:
|
||||||
return session
|
return session
|
||||||
|
|
||||||
def search(self, session):
|
def search(self, session):
|
||||||
|
|
||||||
link = "No link for your application was found."
|
link = "No link for your application was found."
|
||||||
|
|
||||||
return link
|
return link
|
||||||
|
|
||||||
def work(self):
|
def work(self):
|
||||||
session = self.connect()
|
session = self.connect()
|
||||||
|
|
||||||
link = self.search(session)
|
link = self.search(session)
|
||||||
|
|
||||||
return link
|
return link
|
||||||
|
|
Reference in a new issue