forked from AdvancedProgramming1404/HW-5-IMDB-SCRAPER
coding main file.
This commit is contained in:
@@ -8,7 +8,7 @@ public class Main {
|
|||||||
try {
|
try {
|
||||||
// Instantiate the parser
|
// Instantiate the parser
|
||||||
Parser parser = new Parser(filePath);
|
Parser parser = new Parser(filePath);
|
||||||
|
|
||||||
// TODO: You can test your code here before you run the unit tests.
|
// TODO: You can test your code here before you run the unit tests.
|
||||||
// Example: Call your sorting methods, iterate through the returned list,
|
// Example: Call your sorting methods, iterate through the returned list,
|
||||||
// and print out the movies to see if they match the expected results in the Help folder.
|
// and print out the movies to see if they match the expected results in the Help folder.
|
||||||
@@ -26,9 +26,9 @@ public class Main {
|
|||||||
for (Movie movie : parser.sortByYear()) {
|
for (Movie movie : parser.sortByYear()) {
|
||||||
System.out.println(movie);
|
System.out.println(movie);
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.println("Movies parsed successfully! Total movies: " + parser.sortByTitle().size());
|
System.out.println("Movies parsed successfully! Total movies: " + parser.sortByTitle().size());
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
System.err.println("Error reading or parsing the HTML file: " + e.getMessage());
|
System.err.println("Error reading or parsing the HTML file: " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user