Advertisement
dereksir

Untitled

Jun 6th, 2024
720
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.20 KB | None | 0 0
  1. begin
  2.   #...
  3.  
  4.   # select the first product title
  5.   first_product_title = doc.at_css('h2')
  6.   puts first_product_title.text
  7.  
  8. rescue OpenURI::HTTPError => e
  9.   puts "An error occurred: #{e.message}"
  10. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement