0

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!

1 Answer 1

2

URI.open is designed to be an easy to use wrapper for Net::Http but I think you have at least a couple of options:

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.