data parsed to database Nokogiri rails

Posted by Charlie Allombert on Stack Overflow See other posts from Stack Overflow or by Charlie Allombert
Published on 2012-10-18T08:30:51Z Indexed on 2012/10/18 23:01 UTC
Read the original article Hit count: 245

Filed under:
|
|

So I'm just getting started with Nokogiri and Rails I have the following which returns the name of someone.

TEST.rb:

require 'nokogiri'
require 'open-uri'

url = "http://www.imdb.com/title/tt1439629/"
doc = Nokogiri::HTML(open(url))  


puts doc.css("div#wrapper [...too long...]")[0].text

Now I created a table in my DB on rails and want to send the returned name to the actor table in the name column! How would I do that ? I can't seem to find atutorial on this...

My goal would eventually be to have a rails form where I'd input an IMDB link which would return title and so on...

(Also I'm new to ruby rails and programming so please provide easy info!)

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby