From 06c9e9f8f49aa05a8cc8e89f6124aff3b2c2dbc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Mon, 17 Feb 2020 10:07:05 +0100 Subject: [PATCH] Rakefile: update scarper lib --- hardware/Rakefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hardware/Rakefile b/hardware/Rakefile index d833e56..cf1582b 100644 --- a/hardware/Rakefile +++ b/hardware/Rakefile @@ -350,7 +350,7 @@ def scrape_lcsc(sku) # the search page does not always list existing parts, instead it will try url = "https://lcsc.com/pre_search/link?type=lcsc&&value=#{sku}" puts "scraping #{url}" if $scrape_debug - doc = Nokogiri::HTML(open(URI.escape(url),:allow_redirections => :all)) + doc = Nokogiri::HTML(URI.open(url),:allow_redirections => :all) # verify if we have got a product page if doc.xpath('//div[@id="product_details"]').empty? then @@ -381,7 +381,7 @@ def scrape_aliexpress(sku) # get page url = "https://www.aliexpress.com/item/#{sku}.html" puts "scraping #{url}" if $scrape_debug - doc = Nokogiri::HTML(open(URI.escape(url),:allow_redirections => :all)) + doc = Nokogiri::HTML(URI.open(url),:allow_redirections => :all) # all the values can be found in javascript variables (stock is even only there) js_docs = doc.xpath('//script') if js_docs.empty? then