diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2019-03-14 12:47:27 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2019-03-15 08:22:02 +0100 |
commit | 2315d1a34cb777f1731368619a4ca14f46125bb4 (patch) | |
tree | 4e59d1b5f4b5428c59028b2b4795c4e201ec4f27 /src/ee/digikey | |
parent | a8ec679349c3eb9c33a9d33e247fd86cb8e53f81 (diff) | |
download | ee-python-2315d1a34cb777f1731368619a4ca14f46125bb4.tar.gz ee-python-2315d1a34cb777f1731368619a4ca14f46125bb4.tar.bz2 ee-python-2315d1a34cb777f1731368619a4ca14f46125bb4.tar.xz ee-python-2315d1a34cb777f1731368619a4ca14f46125bb4.zip |
o Better searching for current currency.
Diffstat (limited to 'src/ee/digikey')
-rw-r--r-- | src/ee/digikey/__init__.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ee/digikey/__init__.py b/src/ee/digikey/__init__.py index f67e6b5..d0405f1 100644 --- a/src/ee/digikey/__init__.py +++ b/src/ee/digikey/__init__.py @@ -311,7 +311,12 @@ class DigikeyParser(object): @staticmethod def _find_currency(tree: html) -> Optional[str]: - for e in tree.xpath("//*[@id='cur-dropdown']"): + for e in tree.xpath(".//div[@class='cur-dropdown']/ul"): + s = _clean(e.text) + if s: + return s + + for e in tree.xpath("(//*[@class='locale--lang-cur']/*)[last()]"): s = _clean(e.text) if s: return s |