简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM