public static void scrapePatchCategoryPage(String rootURL, String categoryURL, String categoryName, String theme, PreparedStatement stmt) {

        System.out.println("------------\nScraping results page "+categoryURL+"\n--------------");

        Document doc = null;
        try {
            doc = Jsoup.connect(categoryURL).get();
        } catch (IOException e) {
            e.printStackTrace();
            return;
        }

        for (Element listing : doc.select("li.data-tag-index > div.listing-item")) {

            String title = "";
            String address = "";
            double latitude = 0;
            double longitude = 0;
            String pageURL = "";

            // Link

            Element link = listing.select("span[itemprop=name] > strong > a").first();
            title = link.text();
            pageURL = link.attr("href");
            if (pageURL.startsWith("/")) pageURL = rootURL+pageURL;

            address = listing.select("span[itemprop=address]").first().text();

            latitude = Double.parseDouble(listing.select("div[itemprop=geo]").first().select("meta[itemprop=latitude]").first().attr("content"));
            longitude = Double.parseDouble(listing.select("div[itemprop=geo]").first().select("meta[itemprop=longitude]").first().attr("content"));

            JSONObject metadata = getPageMetadata(pageURL);
            try {
                metadata.put("category",categoryName);
            } catch (JSONException e) {
                e.printStackTrace();
            }

            System.out.println("Title: "+title);
            System.out.println("Lat: "+latitude+", Lng: "+longitude);
            System.out.println("Address: "+address);
            System.out.println("Metadata: "+metadata);

            try {
                stmt.setString(1, title);
                stmt.setString(2, address);
                stmt.setDouble(3, latitude);
                stmt.setDouble(4, longitude);
                stmt.setString(5, theme);
                stmt.setString(6, metadata.toString());
                stmt.executeUpdate();
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }

        System.out.println("------------\nFinished a results page\n--------------");

        for (Element potentialNextButton : doc.select("a.light-link[href]")) {
            if (potentialNextButton.text().equals("Next")) {
                String link = potentialNextButton.attr("href");
                if (link.startsWith("?")) {
                    link = categoryURL.split("\\?")[0]+link;
                }
                if (link.startsWith("/")) {
                    link = rootURL+link;
                }
                scrapePatchCategoryPage(rootURL, link, categoryName, theme, stmt);
            }
        }
    }