Skip to content

Instantly share code, notes, and snippets.

@Nesh108
Created October 6, 2015 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nesh108/e3063beee9f465d10029 to your computer and use it in GitHub Desktop.
Save Nesh108/e3063beee9f465d10029 to your computer and use it in GitHub Desktop.
Code:
# Fetching and cleaning up departure time and price
time = res.search("div[@class='onb_col onb_two']/p/strong").first.text.gsub(" ", "").gsub("\n", "").split(" - ")[0].sub("ts","")
price = res.search("p[@class='priceHilite']").first.text.gsub(" ", "").gsub("\n", "").sub("€","")
puts dest
puts time
puts price
print "Dest: " + dest + ","
print "Time: " + time + ","
print "Price: " + price
puts
# Output:
# Hartola
# 23:59
# 13.00
# 13.00,Price: ,Time: Depar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment