调整金额

This commit is contained in:
2026-01-30 15:58:46 +08:00
parent d3af15df1c
commit f7db42d060

View File

@@ -123,7 +123,7 @@ public class LotteryWebMagicCrawler implements PageProcessor {
* @param htmlContent 爬取到的HTML文本内容
* @return 解析后的结构化数据列表
*/
public static List<Map<String, Object>> parseLotteryHtml(String htmlContent) {
public List<Map<String, Object>> parseLotteryHtml(String htmlContent) {
List<Map<String, Object>> resultList = new ArrayList<>();
// 初始化Jsoup解析器
@@ -242,7 +242,7 @@ public class LotteryWebMagicCrawler implements PageProcessor {
return resultList;
}
public static void writeToJsonFile(List<Map<String, Object>> resultList) {
public void writeToJsonFile(List<Map<String, Object>> resultList) {
try {
// 创建 ObjectMapper 实例
ObjectMapper objectMapper = new ObjectMapper();
@@ -251,7 +251,7 @@ public class LotteryWebMagicCrawler implements PageProcessor {
objectMapper.enable(SerializationFeature.INDENT_OUTPUT);
// 定义输出目录
String directoryPath = "PyModel/current_data"; // 项目根目录下的 output/json 文件夹
String directoryPath = path+"/current_data"; // 项目根目录下的 output/json 文件夹
// 使用年月日作为文件名格式result_yyyyMMdd.json
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");