Skip to content

Instantly share code, notes, and snippets.

@wakuteka
Created March 20, 2012 08:13
Show Gist options
  • Save wakuteka/2132698 to your computer and use it in GitHub Desktop.
Save wakuteka/2132698 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'nokogiri'
require 'open-uri'
# Perform a google search
doc = Nokogiri::XML(open('http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=snp&id=7574865&report=XML&mode=xml'))
# Print out each link using a CSS selector
doc.search('Rs Assembly Component MapLoc FxnSet').each do |link|
puts link.attribute('mrnaAcc').to_s + '.' +link.attribute('mrnaVer').to_s
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment