gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 10:27:39 25 4
gpt4 key购买 nike

我正在尝试连接到在线 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com