Advertisement
dereksir

Untitled

Jun 19th, 2024 (edited)
551
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.33 KB | None | 0 0
  1. import com.opencsv.CSVWriter;
  2.  
  3. //...
  4.  
  5. .thenAccept(htmlContent -> {
  6. //...
  7.  
  8.     // initialize CSV writer
  9.     try (CSVWriter csvWriter = new CSVWriter(new FileWriter("products.csv"))) {
  10.     // write header
  11.     csvWriter.writeNext(new String[]{"Product Title", "Image URL", "Link"});
  12.  
  13.     } catch (IOException e) {
  14.         e.printStackTrace();
  15.     }
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement