java爬虫使用Jsoup

java 复制代码
     try {
//            拿到当前剩余余下的钱
            Document doc = Jsoup.connect(url)
                    .header("Authorization", "Bearer " + apiKey)
                    .header("Content-Type", "application/json")
                    .header("Connection", "keep-alive")
                    .data("type", "draw")  // 添加form-data参数
                    .requestBody("""
                             {"name":11,
                             "password":22
                             }
                             """)  //添加body参数
                    .ignoreContentType(true) //忽略所有请求参数
                    .ignoreHttpErrors(true) //忽略所有异常
                    .timeout(200000)
                    .get();



//                拿到一共剩余
            String html = doc.text(); // 获取HTML代码
            JSONObject json =JSONObject.parseObject(html); // 将HTML代码转换为JSON对象
            String total_granted = json.getString("total_granted"); // 一共

配置上面参数最后转换成json格式就可以使用了 对应的jar包可以问我的ai

https://0.00000.work

相关推荐
淡海水12 小时前
02-07-原理篇-GC暂停时间的本质
开发语言·unity·c#·gc·暂停时间
小羊没烦恼!13 小时前
OS X 上使用.NET开发应用程序
开发语言·前端·数据库·人工智能·c#·策略模式
Behavior15 小时前
Unity 7.0 Alpha 拆解:编辑器干掉 Mono 换 CoreCLR
c#·unity3d·游戏开发
淡海水15 小时前
02-06-原理篇-增量式GC与并发GC
算法·unity·c#·并发·gc·增量
Vertira16 小时前
C# 函数封装成 DLL,
开发语言·c#
浅尝辄止;17 小时前
设计模式在HIS/LIS医疗系统中的完整实践指南(C#版)
开发语言·设计模式·c#
kimloner1 天前
开源一个 376KB 的 Windows 桌面小工具:便签 + 截图标注 + OCR + 待办提醒(C# / WinForms)
windows·开源·c#·ocr·winforms
阿松爱学习1 天前
【Unity开发】Aspose.PDF的使用
unity·pdf·c#
半亩码田1 天前
C#转Python第4.8篇:正则表达式:Python re 模块 vs C# System.Text.RegularExpressions
python·正则表达式·c#
FPGA小徐1 天前
【一生一芯 / PA】异常响应机制:RISC-V 中 ecall → mtvec → mret 的完整代
开发语言·数据库·c#