Advertisement
sxiii

AliExpress Price Parsing with Ruby and Nokogiri

Mar 24th, 2017
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.45 KB | None | 0 0
  1. # Ruby AliExpress price fetch example
  2. # Requires nokogiri (sudo gem install nokogiri)
  3. # Save and run as ./ruby.rb
  4. # Written 25.03.2017 by Security XIII
  5.  
  6. require 'open-uri'
  7. require 'nokogiri'
  8.  
  9. url = 'http://ru.aliexpress.com/item/6-12Colors-Non-toxic-Crayon-edible-baby-drawing-Supplies-ring-toy-Easy-to-erase-educational-toys/32753968959.html'
  10. id = 'j-sku-discount-price'
  11.  
  12. doc = Nokogiri::HTML(open(url))
  13. puts doc.css("span[id=#{id}]").inner_text
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement