Skip to content

Commit

Permalink
fix awn_de by disabling ssl check (#1333)
Browse files Browse the repository at this point in the history
Co-authored-by: 5ila5 <5ila5@users.noreply.github.com>
  • Loading branch information
5ila5 and 5ila5 authored Oct 16, 2023
1 parent 7429a95 commit c56906c
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -64,6 +72,7 @@ def fetch(self):
r = session.get(
SERVLET,
params={"SubmitAction": "wasteDisposalServices", "InFrameMode": "TRUE"},
verify=False,
)
r.raise_for_status()
r.encoding = "utf-8"
Expand Down

0 comments on commit c56906c

Please sign in to comment.