Skip to content
This repository has been archived by the owner on May 21, 2022. It is now read-only.

Commit

Permalink
Changed:func name
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjiaH committed May 10, 2022
1 parent 5df4df1 commit 2c783d6
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions common/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def _report(self, location):
return res.text

@logger.catch
def _fetch_address(self):
def _fetch_add(self):
if self._error == 1:
logger.debug(f"The error flag: {self._error}. Exit the function.")
return ["", "", ""]
Expand All @@ -192,10 +192,9 @@ def _fetch_address(self):
res.encoding = "utf-8"
try:
soup = BeautifulSoup(res.text, 'lxml')
address = soup.find("table", class_="table table-hover").find_all("tr")[3].find_all("td")[
1].text.strip()
logger.debug(f'Latest address: "{address}"')
return address.split("|")
add = soup.find("table", class_="table table-hover").find_all("tr")[3].find_all("td")[1].text.strip()
logger.debug(f'Latest address: "{add}"')
return add.split("|")
except Exception as e:
if i != 2:
logger.error(f"Failed to get the latest address. Try next page.[{e}]")
Expand Down Expand Up @@ -225,7 +224,7 @@ def main(self, uid, password):
return 1, self._errno
else:
logger.error("Failed to report in the default method.")
ret = self._report(self._fetch_address())
ret = self._report(self._fetch_add())
if self._existed in ret:
logger.info(f"The report is already existed. ID:{uid}")
return 0, self._errno
Expand Down

0 comments on commit 2c783d6

Please sign in to comment.