parseProducts(String html) {
+ List
products = new ArrayList<>();
+ String productPattern = ".*?
\\s*\\s* ";
+ Pattern pattern = Pattern.compile(productPattern, Pattern.DOTALL);
+ Matcher matcher = pattern.matcher(html);
+
+ while (matcher.find()) {
+ String productHtml = matcher.group();
+ Product product = extractProductInfo(productHtml);
+ if (product != null) {
+ products.add(product);
+ }
+ }
+
+ return products;
+ }
+
+ private static Product extractProductInfo(String productHtml) {
+ String name = extractWithRegex(productHtml, "title=\"([^\"]+)\"\\s+class=\"ga-item\"");
+ String imageUrl = extractWithRegex(productHtml, "src=\"([^\"]+)\"");
+ String specifications = extractWithRegex(productHtml, "