diff --git a/get_specs.py b/get_specs.py index b6c4067..6d59b64 100755 --- a/get_specs.py +++ b/get_specs.py @@ -70,6 +70,8 @@ def query_search(partnum, source): if idx < 0: fprint("Could not find part in API: " + partnum) return False + + name = a["results"][idx]["title"] #fprint("Search result found: result " + str(idx) + ", for ID " + name) #urlname = a["results"][0]["raw"]["catalogitemurlname"] img = a["results"][idx]["raw"]["catalogitemimageurl"] @@ -90,7 +92,7 @@ def query_search(partnum, source): out["description"] = desc out["image"] = "https://www.belden.com" + img out["partnum"] = name - #print(out) + print(out) return out except: print("Failed to search with API. Falling back to datasheet lookup.") @@ -453,8 +455,8 @@ if __name__ == "__main__": "BLC6D1100007" ] - print(query_search("74002", "Belden")) - #get_multi(partnums, 0.25) + #print(query_search("TT-SLG-024-HTNN", "Belden")) + get_multi(partnums, 0.25) #query_search("10GXS13", "Belden")