3 ms·
well... it's a big University... the largest in the country actually, so there are thousands and thousands of classes. I think copying/pasting may be time prohi
by bdclimber14 16y ago
well... it's a big University... the largest in the country actually, so there are thousands and thousands of classes. I think copying/pasting may be time prohibitive.
Is it possible to setup a crawler that would iterate through what could be hundreds of pages, with the same HTML structure, and download/parse the page?
- DanielStraight 16y agoYes. Look up Hpricot or Nokogiri and review the documentation. It will be clear how to get started. Basically you just give it a page and ask it what you want. If you want to handle multiple pages, just iterate through them like you'd iterate through anything else.
- janj 16y agoYes, that is exactly what the crawler should do. I had no crawler experience a few months ago but wanted to do the same thing. I didn't know Ruby so I want the Java route. Now it's trivially easy, I just wrote a crawler last night to pull a bunch of info off hundreds of pages for my next app. First start with how you yourself would get at each page of data. If it all starts from a head page figure out how to get to each link, follow those links and repeat until you are at the data pages. Then point your crawler to the head page and code in the patterns. If the pages are not all linked from a head page but have a url pattern figure out how to pull down the info needed to fill in the url pieces, pull that info down then visit each page filling in the pattern with the data you now have. I can't give any Ruby guidance but if you have general questions on web scraping you can shoot me an email.
- bdclimber14 16y agoThis is awesome... time to dive into hpricot!