Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save matthieu-gendreau/d56df9e716613e66cd59e4c5cff7f9b5 to your computer and use it in GitHub Desktop.
Save matthieu-gendreau/d56df9e716613e66cd59e4c5cff7f9b5 to your computer and use it in GitHub Desktop.
uri = URI.parse('http://www.nasa.gov/mission_pages/station/research/experiments/277.html')
req = Net::HTTP::Get.new(uri.to_s)
res = Net::HTTP.start(uri.host, uri.port) { |http| http.request(req) }
doc = res.body.gsub(/(\n|\t)/, '').force_encoding('UTF-8')
A cette étape j'ai tout ce qu'il me faut notamment la string 'awarded patents'
Si je fais un 'puts doc', là ça me tronque le 'awarded patents' et j'ai plus que 'awarded'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment