From f2df2625b1ef2be2fb5698dca208cbe89f13e77e Mon Sep 17 00:00:00 2001 From: j4asper Date: Wed, 27 Jul 2022 22:56:58 +0200 Subject: [PATCH] Enable ssl verification again --- dmr/utils/async_scraper.py | 6 +++--- dmr/utils/scraper.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dmr/utils/async_scraper.py b/dmr/utils/async_scraper.py index c301db4..e71128e 100644 --- a/dmr/utils/async_scraper.py +++ b/dmr/utils/async_scraper.py @@ -7,7 +7,7 @@ async def scrape_async(license_plate:str): async def get_token(session): """Get dmrFormToken""" - async with session.get("https://motorregister.skat.dk/dmr-kerne/koeretoejdetaljer/visKoeretoej", headers=get_headers(), allow_redirects=True, ssl=False) as resp: + async with session.get("https://motorregister.skat.dk/dmr-kerne/koeretoejdetaljer/visKoeretoej", headers=get_headers(), allow_redirects=True) as resp: content = await resp.text() source = fromstring(content) try: @@ -28,7 +28,7 @@ async def get_token(session): new_url: "Søg" } - async with session.post('https://motorregister.skat.dk' + new_url, data=payload, headers=get_headers({"Referer":"https://motorregister.skat.dk" + new_url}), allow_redirects=True, ssl=False) as resp: + async with session.post('https://motorregister.skat.dk' + new_url, data=payload, headers=get_headers({"Referer":"https://motorregister.skat.dk" + new_url}), allow_redirects=True) as resp: content = await resp.text() if "Ingen køretøjer fundet." in content: @@ -40,7 +40,7 @@ async def get_token(session): data = page_1(source) second_page = source.xpath('/html/body/div[2]/div/div[1]/div[2]/div[3]/div/div[1]/ul/li[2]/div/a')[0].get("href") - async with session.get("https://motorregister.skat.dk" + second_page, headers=get_headers({"Referer":"https://motorregister.skat.dk" + new_url[:-16]}), allow_redirects=True, ssl=False) as resp: + async with session.get("https://motorregister.skat.dk" + second_page, headers=get_headers({"Referer":"https://motorregister.skat.dk" + new_url[:-16]}), allow_redirects=True) as resp: content = await resp.text() source = fromstring(content) diff --git a/dmr/utils/scraper.py b/dmr/utils/scraper.py index 014bb9f..2b5e564 100644 --- a/dmr/utils/scraper.py +++ b/dmr/utils/scraper.py @@ -7,7 +7,7 @@ def scrape(license_plate:str): def get_token(session): """Get dmrFormToken""" - resp = session.get("https://motorregister.skat.dk/dmr-kerne/koeretoejdetaljer/visKoeretoej", headers=get_headers(), allow_redirects=True, verify=False) + resp = session.get("https://motorregister.skat.dk/dmr-kerne/koeretoejdetaljer/visKoeretoej", headers=get_headers(), allow_redirects=True) source = fromstring(resp.text) try: token = source.xpath('/html/body/div[2]/div/div[1]/div[2]/form/input')[0].get("value") @@ -27,7 +27,7 @@ def get_token(session): new_url: "Søg" } - resp = session.post('https://motorregister.skat.dk' + new_url, data=payload, headers=get_headers({"Referer":"https://motorregister.skat.dk" + new_url}), allow_redirects=True, verify=False) + resp = session.post('https://motorregister.skat.dk' + new_url, data=payload, headers=get_headers({"Referer":"https://motorregister.skat.dk" + new_url}), allow_redirects=True) if "Ingen køretøjer fundet." in resp.text: # Licens plate doesn't exist @@ -38,7 +38,7 @@ def get_token(session): second_page = source.xpath('/html/body/div[2]/div/div[1]/div[2]/div[3]/div/div[1]/ul/li[2]/div/a')[0].get("href") - resp = session.get("https://motorregister.skat.dk" + second_page, headers=get_headers({"Referer":"https://motorregister.skat.dk" + new_url[:-16]}), allow_redirects=True, verify=False) + resp = session.get("https://motorregister.skat.dk" + second_page, headers=get_headers({"Referer":"https://motorregister.skat.dk" + new_url[:-16]}), allow_redirects=True) source = fromstring(resp.text) data.update(page_2(source))