From db3e1ccfe1698c9f3f55d0d0b4c0757d184ab7bf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 20 Jun 2023 23:11:56 +0200 Subject: [PATCH] Continued: - also check for ' dict: ) # DEBUG: print(f"DEBUG: response.ok='{response.ok}',response.status_code={response.status_code},response.text()={len(response.text)}") - if response.ok and len(response.text) > 0: + if response.ok and response.status_code < 300 and response.text.find(" 0: # Save cookies + # DEBUG: print(f"DEBUG: Parsing response.text()={len(response.text)} Bytes ...") cookies.store(domain, response.cookies.get_dict()) # Parse text diff --git a/fba/federation.py b/fba/federation.py index ec71617..1d15450 100644 --- a/fba/federation.py +++ b/fba/federation.py @@ -401,8 +401,8 @@ def fetch_generator_from_path(domain: str, path: str = "/") -> str: response = network.fetch_response(domain, path, network.web_headers, (config.get("connection_timeout"), config.get("read_timeout"))) # DEBUG: print("DEBUG: domain,response.ok,response.status_code,response.text[]:", domain, response.ok, response.status_code, type(response.text)) - if response.ok and response.status_code < 300 and len(response.text) > 0: - # DEBUG: print("DEBUG: Search for :", domain) + if response.ok and response.status_code < 300 and response.text.find(" 0: + # DEBUG: print(f"DEBUG: Parsing response.text()={len(response.text)} Bytes ...") doc = bs4.BeautifulSoup(response.text, "html.parser") # DEBUG: print("DEBUG: doc[]:", type(doc)) -- 2.39.5