kkevlar / section-searcher

Project for CSC 308 and 309
1 stars 0 forks source link

Use HtmlUnit to scrape and parse #52

Closed kkevlar closed 5 years ago

kkevlar commented 5 years ago

Closes #49 Closes #45 Closes #51

kkevlar commented 5 years ago
try (final WebClient webClient = new WebClient()) {
            final HtmlPage page = webClient.getPage("http://schedules.calpoly.edu/subject_CSC_curr.htm");
            final HtmlTable table = page.getHtmlElementById("listing");
            for (final HtmlTableRow row : table.getRows()) {
                System.out.print("\n");
                for (final HtmlTableCell cell : row.getCells()) {
                    System.out.print("\"" + cell.asText() + "\"" +",");
                }
            }
        }

Using http://htmlunit.sourceforge.net/table-howto.html