This week's book giveaway is in the OCP forum.
We're giving away four copies of OCP Java SE 8 Programmer II Exam Study Guide and have Kathy Sierra, Bert Bates, & Elizabeth Robson on-line!
See this thread for details.
Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

SCRAPE  RSS feed

 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just wondering if anyone has any information they can pass along about scraping information from web sites like stock quotes or movie listing for example. I am interested to see what it would take.
Thanks in advance.
 
Author and ninkuma
Marshal
Posts: 66535
160
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can pretty easily "suck in" the HTML at any URL via java.net.URLConnection.
From there you can either parse the HTML (google for various HTML parsers) or simply use some regular expression searches depending upon your needs.
bear
P.S. There are ethical considerations to screen scraping, so please be sure not to use any "scraped" data in a way other than the intent of the original publishers.
 
Aaron O'Brien
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear,
I will be sure to give this a try...and to use my program wisely.
Take Care.
 
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Once you are pulling content from other sites, the Quiotix Parser may make understanding it easier.
 
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also check out the Scrape Tag Library.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!