From 79b8525e776b27a1702a4eea6f3168bfd97a393a Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Thu, 7 Feb 2019 23:35:09 +0100 Subject: o Updating digikey product parsing code. Using Selenium/WebDriver to fetch data. --- requirements.txt | 2 + src/ee/digikey/__init__.py | 2 +- test/digikey/static-copies/search-RS1MTR.html | 2072 +++++++ test/digikey/static-copies/search-S1MTR.html | 2504 +++++--- test/digikey/static-copies/search-TCR2LF.html | 6212 +++++++++++++------- .../static-copies/search-TCR2LF10LM(CTTR-ND.html | 3253 +++++----- .../static-copies/search-TCR2LF12LM(CTTR-ND.html | 3271 ++++++----- .../static-copies/search-TCR2LF15LM(CT-ND.html | 3081 ++++++---- .../static-copies/search-TCR2LF18LM(CTTR-ND.html | 3351 ++++++----- .../static-copies/search-TCR2LF19LM(CTTR-ND.html | 2211 +++++++ .../static-copies/search-TCR2LF25LM(CTTR-ND.html | 3416 ++++++----- .../static-copies/search-TCR2LF27LM(CTTR-ND.html | 3243 +++++----- .../static-copies/search-TCR2LF30LM(CTTR-ND.html | 3356 ++++++----- .../static-copies/search-TCR2LF32LM(CTTR-ND.html | 3227 +++++----- .../static-copies/search-TCR2LF33LM(CTTR-ND.html | 3403 ++++++----- .../static-copies/search-TCR2LF36LM(CTTR-ND.html | 3277 ++++++----- test/test_digikey.py | 46 +- 17 files changed, 29417 insertions(+), 16510 deletions(-) create mode 100644 test/digikey/static-copies/search-RS1MTR.html create mode 100644 test/digikey/static-copies/search-TCR2LF19LM(CTTR-ND.html diff --git a/requirements.txt b/requirements.txt index bf89db3..308badc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,6 +16,8 @@ pytest==3.6.3 requests==2.19.1 tox==3.1.2 +selenium==3.141.0 + # for development jupyter==1.0.0 doit==0.30.3 diff --git a/src/ee/digikey/__init__.py b/src/ee/digikey/__init__.py index dcd21b2..615d458 100644 --- a/src/ee/digikey/__init__.py +++ b/src/ee/digikey/__init__.py @@ -239,7 +239,7 @@ class DigikeyClient(object): for n in tree.xpath("//*[@itemprop='name' and @content]"): mpn = n.get("content") - for tr in tree.xpath("//table[@id='prod-att-table']/tr[not(@id='prod-att-title-row')]"): + for tr in tree.xpath("//table[@id='product-attribute-table']/*/tr[not(@id)]"): tds = tr.xpath("th|td") if len(tds) != 3: continue diff --git a/test/digikey/static-copies/search-RS1MTR.html b/test/digikey/static-copies/search-RS1MTR.html new file mode 100644 index 0000000..aa12227 --- /dev/null +++ b/test/digikey/static-copies/search-RS1MTR.html @@ -0,0 +1,2072 @@ + + Diodes - Rectifiers - Single | Discrete Semiconductor Products | DigiKey + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + +
+ + +

Product Index > Discrete Semiconductor Products > Diodes - Rectifiers - Single

+ + +
+
Results: 4
+ +
+
+
+
+
+ + + + +
+
+ Filter Options: + +
+
+
+
+
+ Manufacturer + + + +
+ +
+
+ Packaging + + + +
+ +
+
+ Part Status + + + +
+ +
+
+ +
+ +
+ Sort Results By: + + +
+ + + + + +
+ View Prices At: ? + + +
+ + +
+
+
    +
  • Stock Status
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
+
+
+
    +
  • Media Available
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
+
+
+
    +
  • Environmental
  • +
  • + + +
  • +
  • + + +
  • +
+
+
+
+
+ + + + + + +
+ +
+ + + +
+ + + +
+
+
+
+ +
+ + + + + + + + + + + RS1MTR + +
+
+
+
+ + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + + +
+
+
+ Results per Page + +
+
+ Page 1/1 +
+
+
+ + + + + + + + + + + +
+
+ +
+ +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Compare Parts + Datasheets + ImageDigi-Key Part NumberManufacturer Part NumberManufacturerDescription + Quantity Available +
+ ? +
+ Unit Price +
+ USD +
+ ? +
+ Minimum Quantity +
+ ? +
PackagingSeriesPart StatusDiode TypeVoltage - DC Reverse (Vr) (Max)Current - Average Rectified (Io)Voltage - Forward (Vf) (Max) @ IfSpeedReverse Recovery Time (trr)Current - Reverse Leakage @ VrCapacitance @ Vr, FMounting TypePackage / CaseSupplier Device PackageOperating Temperature - Junction
+ +    +
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+ + + + + RS1MTR Datasheet + + + + RS1MTR - SMC Diode Solutions + + + + + 1655-1501-2-ND + +
+ + This part is RoHS compliant. + + + +
+ Tariff Applied + ? +
+
+ +
+ + + + + + + + DIODE GEN PURP 1KV 1A SMA + + + 215,000 - Immediate + + + Available: 215,000 + + + + + $0.02940 + + + + + 5,000 + + + + Minimum: 5,000 + + + + +Tape & Reel (TR)?
+Alternate Packaging
+
-
+ +
+ + Active + + + + Standard + + 1000V + + 1A + + 1.3V @ 1A + + Fast Recovery =< 500ns, > 200mA (Io) + + 500ns + + 5µA @ 1000V + + 15pF @ 4V, 1MHz + + Surface Mount + + DO-214AC, SMA + + SMA + + -65°C ~ 150°C +
+ + + + + RS1MTR Datasheet + + + + RS1MTR - SMC Diode Solutions + + + + + 1655-1501-1-ND + +
+ + This part is RoHS compliant. + + + +
+ Tariff Applied + ? +
+
+ +
+ + + + + + + + DIODE GEN PURP 1KV 1A SMA + + + 218,737 - Immediate + + + Available: 218,737 + + + + + $0.18000 + + + + + 1 + + + + Minimum: 1 + + + + +Cut Tape (CT)?
+Alternate Packaging
+
-
+ +
+ + Active + + + + Standard + + 1000V + + 1A + + 1.3V @ 1A + + Fast Recovery =< 500ns, > 200mA (Io) + + 500ns + + 5µA @ 1000V + + 15pF @ 4V, 1MHz + + Surface Mount + + DO-214AC, SMA + + SMA + + -65°C ~ 150°C +
+ + + + + RS1MTR Datasheet + + + + RS1MTR - SMC Diode Solutions + + + + + 1655-1501-6-ND + +
+ + This part is RoHS compliant. + + + +
+ Tariff Applied + ? +
+
+ +
+ + + + + + + + DIODE GEN PURP 1KV 1A SMA + + + 218,737 - Immediate + + + Available: 218,737 + + + + Digi-Reel® + + + + 1 + + + + Minimum: 1 + + + + +Digi-Reel®?
+Alternate Packaging
+
-
+ +
+ + Active + + + + Standard + + 1000V + + 1A + + 1.3V @ 1A + + Fast Recovery =< 500ns, > 200mA (Io) + + 500ns + + 5µA @ 1000V + + 15pF @ 4V, 1MHz + + Surface Mount + + DO-214AC, SMA + + SMA + + -65°C ~ 150°C +
+ + + + + RS1M-13 Datasheet + + + + RS1M-13 - Diodes Incorporated + + + + + RS1MDITR-ND + +
+ + This part is RoHS non-compliant. + + + +
+ +
+ + + + + + + + DIODE GEN PURP 1KV 1A SMA + + + 0 + + + Available: 0 + + + +
Discontinued at Digi-Key
+ +
+
-
+
+ +Tape & Reel (TR)? +
-
+ +
+ + Discontinued at Digi-Key + + + + Standard + + 1000V + + 1A + + 1.3V @ 1A + + Fast Recovery =< 500ns, > 200mA (Io) + + 500ns + + 5µA @ 1000V + + 15pF @ 4V, 1MHz + + Surface Mount + + DO-214AC, SMA + + SMA + + -65°C ~ 150°C +
+ + +
+ +
+
+
+ Results per Page + +
+
+ Page 1/1 +
+
+ +
+
+
+
+ +

16:20:13 2/7/2019

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/digikey/static-copies/search-S1MTR.html b/test/digikey/static-copies/search-S1MTR.html index 5a54eb7..4487e78 100644 --- a/test/digikey/static-copies/search-S1MTR.html +++ b/test/digikey/static-copies/search-S1MTR.html @@ -1,878 +1,571 @@ + + Electronic Components and Parts Search | DigiKey Electronics - - - - - - + + + - - - Electronic Components and Parts Search | DigiKey Electronics - + + + + + + + + + + + + + + + + - - - - - - -