I am trying to get a .sql file from an http web server using this code.
Nokogiri::HTML(open($sql_file,:http_basic_authentication=>[@usr, @pwd]))
But i do get the sql file with some html tags.(e.g <html><body><p> at the beginning and at the end).
Do you know how can i get the file as plain text .sql file.
Nokogiri is for handling HTML and XML files. If you just want the raw text file, you don’t need or want Nokogiri.
Use just the
open-urilibrary (which you are already using) along with itsreadmethod to fetch the contents: