2
Ruby parse HTTP response
deeptishukla24 (2)

require 'net/http'
uri = URI('https://www.random.org/dice/?num=10')
Net::HTTP.get(uri)

I'm using the above code to call this random dice generator.
I'm able to get the entire http response using the get method above.
But I'm stuck on how to access the result from that big HTML string?
I'm just trying to access the individual dice values (10 in this case).
Thanks!

You are viewing a single comment. View All
Answered by heyitsmarcus (285) [earned 5 cycles]
View Answer
1
deeptishukla24 (2)

@heyitsmarcus Thanks a ton!! This is perfect! I upvoted the answer. How do I mark it as the accepted answer?