lib/spidr/page/html.rb in spidr-0.7.0 vs lib/spidr/page/html.rb in spidr-0.7.1
- old
+ new
@@ -1,7 +1,10 @@
+# frozen_string_literal: true
+
+require_relative '../extensions/uri'
+
require 'nokogiri'
-require 'spidr/extensions/uri'
module Spidr
class Page
include Enumerable
@@ -263,10 +266,10 @@
#
def to_absolute(link)
link = link.to_s
new_url = begin
url.merge(link)
- rescue Exception
+ rescue URI::Error
return
end
if (!new_url.opaque) && (path = new_url.path)
# ensure that paths begin with a leading '/' for URI::FTP