c++ - 如何将文本从网站复制到 C++ 中的字符串?

标签 c++ api curl libraries

我正在尝试连接到在线 API,获取网站上的所有文本,然后将其复制并粘贴到字符串中。
网址是 https://api.hypixel.net/skyblock/bazaar?key=[KEYHERE]
https://api.hypixel.net/skyblock/profile?key=[MyKey]&profile=[MyProfile]
(网址被审查)。
到目前为止,这是我的代码:

#include <iostream>
#include <windows.h>
#include <string>
#include <cstdlib>
using namespace std;

int main()
{
    string URLPurse = "https://api.hypixel.net/skyblock/profile?key=[MyKey]&profile=[MyProfile]";
    string URLEnder = "https://api.hypixel.net/skyblock/bazaar?key=[MyKey]";
    //read text from both APIs
    string answerPurse = [text from the player api];
    string answerEnder = [text from the bazzar api];

    // Do stuff with the text
}
我对编程非常陌生,我不知道如何下载或使用 cURL,但是有没有办法在没有外部库的情况下做到这一点?如果没有你能解释我如何下载和使用 cURL 来实现这一点? (我使用的是 32 位和 Code::Blocks 的 Windows 7)。例如,我也不能使用任何其他编程语言,例如 java。
(我知道我使用了太多的库)

最佳答案

尝试使用 selenium,它在 python 中,我也相信 c++,你可以定位 html 元素并使用它们,但是你想

关于c++ - 如何将文本从网站复制到 C++ 中的字符串?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63624620/

相关文章:

api - 通过 API 获取 Jenkins Metrics 数据

python - 帖子请求中禁止 (403) - django rest-react

c++ - 使用 C++ ADODB CommandPtr::Execute() 从存储过程获取记录集

c++ - 将规则生成绑定(bind)到我的结构成员时出现编译错误

c++ - 在 Visual Studio 下使用 pair 作为 hash_map 的键

python - 如何使用 JSON 从 twitter API 获取完整的状态文本?

c++ - 第 5 行 : Char 54: error: no matching function for call to 'min(int, std::__cxx11::basic_string<char>::size_type)'

php - Paypal API,Curl 不返回任何输出

php - 为什么 PHP curl 不起作用?当它从命令行 curl 工作时?

php - 如何在 php 中将表单变量发送到多个 URL(cURL?)