I’m building a simple news aggregator with Ruby. I am completely new to the language, and I just found out how to use the open uri function.
Now, my problem is how to parse the html page. Is there a built in parser in Ruby.
btw, I do not use rails and I want it to be very simple
Thanks in advance!
The simple answer is yes, there’s a parser. I can’t answer your question specifically without knowing what you’re trying to extract from the html but I’ve included some source code below. If your able to read ruby code, then it’s pretty self explanatory.
produces:
Here’s another link showing an example of how to use open-uri: http://juretta.com/log/2006/08/13/ruby_net_http_and_open-uri/