I am parsing a web page using nokogiri
gem like the code below:
require 'open-uri'
url = 'https://www.google.com/' # example url
Nokogiri::HTML(URI.open(url))
# ... some other codes
I would like to use proxy with open-uri
. I have looked through the documentation, but the example code is without using proxy.
How can I use proxy when using URI.open
? I would appreciate any help with syntax explanation or some example code. Thank you!