aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2019-03-14 12:47:27 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2019-03-15 08:22:02 +0100
commit2315d1a34cb777f1731368619a4ca14f46125bb4 (patch)
tree4e59d1b5f4b5428c59028b2b4795c4e201ec4f27 /src
parenta8ec679349c3eb9c33a9d33e247fd86cb8e53f81 (diff)
downloadee-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')
-rw-r--r--src/ee/digikey/__init__.py7
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