From 82e2b93cd58cf28803140a4fed5ac9dafb5a9649 Mon Sep 17 00:00:00 2001 From: "Tobias Wellnitz, DH1TW" Date: Thu, 12 May 2022 01:43:23 +0200 Subject: [PATCH] using lxml to parse qrz.com xml responses instead of html.parser --- docs/source/changelog.rst | 9 +++++++++ pyhamtools/lookuplib.py | 3 ++- pyhamtools/version.py | 2 +- requirements-pytest.txt | 2 +- setup.py | 3 ++- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index 79fcddb..53fd0d3 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -1,6 +1,15 @@ Changelog --------- +PyHamtools 0.7.10 +================ + +12. May 2022 + +* Using lxml to parse XML messages returned from qrz.com +* Upgraded dependencies + + PyHamtools 0.7.9 ================ diff --git a/pyhamtools/lookuplib.py b/pyhamtools/lookuplib.py index 8d6592c..3ea6f48 100644 --- a/pyhamtools/lookuplib.py +++ b/pyhamtools/lookuplib.py @@ -136,7 +136,8 @@ class LookupLib(object): else: encodeurl = url + "?" + urllib.urlencode(params) response = requests.get(encodeurl, timeout=10) - doc = BeautifulSoup(response.text, "html.parser") + # doc = BeautifulSoup(response.text, "html.parser") + doc = BeautifulSoup(response.text, "lxml") session_key = None if doc.session.key: session_key = doc.session.key.text diff --git a/pyhamtools/version.py b/pyhamtools/version.py index 51328ec..a6ed61a 100644 --- a/pyhamtools/version.py +++ b/pyhamtools/version.py @@ -1,3 +1,3 @@ -VERSION = (0, 7, 9) +VERSION = (0, 7, 10) __release__ = ''.join(['-.'[type(x) == int]+str(x) for x in VERSION])[1:] __version__ = '.'.join((str(VERSION[0]), str(VERSION[1]))) diff --git a/requirements-pytest.txt b/requirements-pytest.txt index ff56c01..d1db895 100644 --- a/requirements-pytest.txt +++ b/requirements-pytest.txt @@ -1,4 +1,4 @@ -pytest>=6.2.2; python_version>='3.6' +pytest>=7.0.0; python_version>='3.6' pytest==4.6.11; python_version<='3.5' and python_version>='2.7' pytest-blockage>=0.2.2 pytest-localserver>=0.5 diff --git a/setup.py b/setup.py index 045c9e9..a4194df 100755 --- a/setup.py +++ b/setup.py @@ -20,7 +20,8 @@ setup(name='pyhamtools', "requests>=2.21.0", "ephem>=4.1.3", "beautifulsoup4>=4.7.1", - "future>=0.17.1", + "lxml>=4.8.0", + "future>=0.18.2", "redis>=2.10.6", ], **kw