Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed loglevel of _get_xml
Browse files Browse the repository at this point in the history
CommanderStorm committed Mar 21, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 3867325 commit 7127d47
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions data/external/scrapers/tumonline.py
Original file line number Diff line number Diff line change
@@ -223,13 +223,11 @@ def scrape_orgs(lang):
def _retrieve_roomlist(f_type, f_name, f_value, area_id=0):
"""Retrieve all rooms (multi-page) from the TUMonline room search list"""

logging.info(f"Retrieving {f_type} {f_value}")

all_rooms = []
pages_cnt = 1
current_page = 0

with tqdm(desc="Searching for Rooms", total=pages_cnt, leave=False) as prog:
with tqdm(desc=f"Searching Rooms for {f_type} {f_value}", total=pages_cnt, leave=False) as prog:
while current_page < pages_cnt:
search_params = {
"pStart": len(all_rooms) + 1, # 1 + current_page * 30,
@@ -356,7 +354,7 @@ def _get_xml(url: str, params: dict, cache_fname: str):
tree = ET.parse(cache_path)
return tree.getroot()

logging.info(f"GET {url}", params)
logging.debug(f"GET {url}", params)
req = requests.get(url, params)
with open(cache_path, "w", encoding="utf-8") as file:
file.write(req.text)

0 comments on commit 7127d47

Please sign in to comment.