Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Treehouse Please Offer a Web-scraping Deep Dive

Hello Treehouse staff.

I think it would be most beneficial if you offered a web-scraping class that shows how to do it. I have been using Nokogiri in Ruby to do it, but information even on the web can be confusing. It would be nice to learn from you guys.

6 Answers

Andrew Chalkley
STAFF
Andrew Chalkley
Treehouse Guest Teacher

Hi Andrew Cottage,

Whilst we've got no immediate plans for a Deep Dive in web scraping, I thought it would be good to do a "shallow paddle" (that's not a real thing).

In this video I use a Rake task to kick off the scraping process. I use the Rubygem Nokogiri to create a simple spider and scraper.

Hope this helps!
Regards
Andrew

Where'd the beard come from Chalkley???

It's like Jim Hoskins junior :wink:

Excellent likeness. Well, just got to watch the Hoskins - Chalkley big day out video. :D

They should really do a sequel to that now that they've got matching beards.

I will pay to see that.

Andrew Chalkley
Andrew Chalkley
Treehouse Guest Teacher

I don't know where it came from. It just turned up one day. I think it's a side effect of living in Portland.

In case if any of you find this video too complicated, web scraping with node + cheerio module is much easier and natural. It uses the same Jquery syntax every front-end developer is familiar with.

JQuery syntax that sounds pretty exciting. I love me some JQuery.

Andrew Chalkley
Andrew Chalkley
Treehouse Guest Teacher

I was tempted to do that + Jim Hoskins was saying to do it too. But the request was for Ruby / Nokogiri :)

Do one for jQuery and normal sites Andrew Chalkley :)

Great video ! You made it sound so easy !

Thanks Andrew Chalkley . This video answered so many questions that I had when it comes to incorporating a nokogiri scrape inside of a rails project. Keep up the great work!

This was great. Thanks for sharing this.