fix awn_de by disabling ssl check (#1333)

Co-authored-by: 5ila5 <5ila5@users.noreply.github.com>
This commit is contained in:
5ila5
2023-10-16 20:36:08 +02:00
committed by GitHub
parent 7429a9576f
commit c56906c49b

View File

@@ -1,10 +1,18 @@
from html.parser import HTMLParser
import requests
from waste_collection_schedule import Collection # type: ignore[attr-defined]
from waste_collection_schedule.service.ICS import ICS
# With verify=True the POST fails due to a SSLCertVerificationError.
# Using verify=False works, but is not ideal. The following links may provide a better way of dealing with this:
# https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
# https://urllib3.readthedocs.io/en/1.26.x/user-guide.html#ssl
# These two lines areused to suppress the InsecureRequestWarning when using verify=False
import urllib3
urllib3.disable_warnings()
TITLE = "Abfallwirtschaft Neckar-Odenwald-Kreis"
DESCRIPTION = "Source for AWN (Abfallwirtschaft Neckar-Odenwald-Kreis)."
URL = "https://www.awn-online.de"
@@ -64,6 +72,7 @@ class Source:
r = session.get(
SERVLET,
params={"SubmitAction": "wasteDisposalServices", "InFrameMode": "TRUE"},
verify=False,
)
r.raise_for_status()
r.encoding = "utf-8"