add images updater from url

This commit is contained in:
Σlie *
2026-02-27 19:42:45 +01:00
parent 26ccc39a89
commit 05b8f2841e
4 changed files with 234 additions and 22 deletions

View File

@ -3,19 +3,13 @@ package fr.tetelie.crawler;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class Crawler {
public static void main(String[] args) {
new WebScrapper();
new DatabaseConfig();
boolean isConnected = DatabaseConfig.getInstance().connect();
@ -23,7 +17,9 @@ public class Crawler {
if(!isConnected){return;};
String url = "https://www.amazon.fr/Victool-temp%C3%A9rature-professionnel-r%C3%A9paration-%C3%A9lectronique/dp/B0FP2D7TBY/?_encoding=UTF8&pd_rd_w=UWXHj&content-id=amzn1.sym.5633189b-a269-4b24-8a80-52a48568a326%3Aamzn1.symc.752cde0b-d2ce-4cce-9121-769ea438869e&pf_rd_p=5633189b-a269-4b24-8a80-52a48568a326&pf_rd_r=G56TKFERTQ9WS62C7WY4&pd_rd_wg=mtTBQ&pd_rd_r=519dfa29-c58c-41b3-89ca-4d01e27bfc2e&ref_=pd_hp_d_atf_ci_mcx_mr_ca_hp_atf_d";
DatabaseConfig.getInstance().updatesAllMissingImages();
/*String url = "https://www.amazon.fr/Victool-temp%C3%A9rature-professionnel-r%C3%A9paration-%C3%A9lectronique/dp/B0FP2D7TBY/?_encoding=UTF8&pd_rd_w=UWXHj&content-id=amzn1.sym.5633189b-a269-4b24-8a80-52a48568a326%3Aamzn1.symc.752cde0b-d2ce-4cce-9121-769ea438869e&pf_rd_p=5633189b-a269-4b24-8a80-52a48568a326&pf_rd_r=G56TKFERTQ9WS62C7WY4&pd_rd_wg=mtTBQ&pd_rd_r=519dfa29-c58c-41b3-89ca-4d01e27bfc2e&ref_=pd_hp_d_atf_ci_mcx_mr_ca_hp_atf_d";
try {
// IMPORTANT : Amazon bloque les requêtes sans "User-Agent"
@ -56,6 +52,6 @@ public class Crawler {
} catch (Exception e) {
e.printStackTrace();
}
}*/
}
}