0

I am looking for a Java tool to scrape a CSV from a website and then parse the data. Jsoup seems like a viable option. Is there a way to scrape a CSV file and then save the information to a database using Jsoup?

Or is it strictly for scraping HTML code? Thanks.

Community
  • 1
  • 1
  • 1
    The [`Apache Commons CSV`](https://commons.apache.org/proper/commons-csv/) is a new project this year for parsing and generating comma-separated values (CSV) and TAB-delimited files. Release 1.1 just arrived this month (2014-11). Similar to JSoup in that it uses a simple clean API to create objects representing the parsed data. – Basil Bourque Nov 27 '14 at 22:03

1 Answers1

0

No, it ain't gonna work. Look at the Jsoup description:

jsoup is a Java library for working with real-world HTML. It provides a very convenient API for extracting and manipulating data, using the best of DOM, CSS, and jquery-like methods.

jsoup implements the WHATWG HTML5 specification, and parses HTML to the same DOM as modern browsers do.

What you are asking for is how to parse CSV file in Java. This question might be helpful for you:

Fast CSV parsing

Community
  • 1
  • 1
Szymon Stepniak
  • 40,216
  • 10
  • 104
  • 131