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

相关推荐
用户7884773163412 小时前
WinForms 迁移 WPF:Upgrade Assistant 覆盖 30%,剩下 70% 我手写了六周
c#
寂寞的船16 小时前
【Unity知识速递】第13期 Unity 内存泄漏排查实战:从 Memory Profiler 到 Lua 引用泄漏的生产级全链路诊断
unity·junit·c#·游戏引擎·lua
用户3721574261351 天前
C# 提取 PDF 附件:包括文档附件和页面注释附件
c#
寂寞的船1 天前
【Unity Bug挑战】第12期 Awaitable 二次 await 死锁之谜 —— 为什么同一个异步操作等两次就卡死?
unity·c#·游戏引擎·bug
huaqianzkh3 天前
WinForm C#:循环修改控件UI闪烁卡顿?SuspendLayout / ResumeLayout 与 BeginUpdate 优化
开发语言·ui·c#
用户3721574261353 天前
C# 实现 Excel 单元格保护:锁定公式并允许编辑指定区域
c#·ai编程·编程语言
公子小六4 天前
基于.NET的Windows窗体编程之WinForms数据持久化(1)
windows·microsoft·c#·.net·winforms
三雷科技4 天前
第6章第4节:自定义分词器
开发语言·c#
zhanghaha13144 天前
C# 系列教程_12 字符串 string 保姆级系统教程(面向新手,大量示例 + 原理讲解)
开发语言·数据库·c#
Coder_Shenshen4 天前
罗克韦尔ACD工程归档离线变量树解析
算法·c#