zmieniono print na logging
zmieniono wyjscie cron z pliku na stdout i stderr
This commit is contained in:
4
mayo.py
4
mayo.py
@@ -1,6 +1,7 @@
|
||||
import requests
|
||||
from bs4 import BeautifulSoup
|
||||
import re
|
||||
import logging
|
||||
|
||||
class MayoSession:
|
||||
def __init__(self, base_url, login, password, db="1"):
|
||||
@@ -23,7 +24,7 @@ class MayoSession:
|
||||
r = self.session.post(self.login_url, data=self.credentials)
|
||||
if "Zaloguj się" in r.text or "login" in r.url:
|
||||
raise Exception("Nie udało się zalogować do Mayo.")
|
||||
print("✅ Zalogowano poprawnie do systemu Mayo.")
|
||||
logging.info("✅ Zalogowano poprawnie do systemu Mayo.")
|
||||
|
||||
def get_order_info(self, url):
|
||||
"""
|
||||
@@ -62,7 +63,6 @@ class MayoSession:
|
||||
value = None
|
||||
# Wartość jest zazwyczaj pomiędzy myślnikiem a ukośnikiem
|
||||
match = re.search(r'-\s*([^/]+)', text)
|
||||
# print(f"label: {label}, match: {match}, text: {text}")
|
||||
if match:
|
||||
value = match.group(1).strip()
|
||||
color_sections[label] = value
|
||||
|
||||
Reference in New Issue
Block a user