David Ang
David Ang

Reputation: 187

how to use capybara on your rails controller?

Basically i wanted to scrape a site, eg i want my app to go to google.com, do a search then get the total number of results.

So I'd use capybara to do that - but it seems I can't get it to work inside my rails controllers.

So either i use capybara to scrape a site or you guys can suggest an easier way?

Many thanks in advance.

Upvotes: 1

Views: 350

Answers (1)

Chamnap
Chamnap

Reputation: 4766

I suggest you could try with these 2 screencasts from railscasts, fairly simple.

http://railscasts.com/episodes/190-screen-scraping-with-nokogiri

http://railscasts.com/episodes/173-screen-scraping-with-scrapi

Upvotes: 3

Related Questions