Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <onidev/markup.h>
- #include <onidev/core/tools.h>
- #include <algorithm>
- int main()
- {
- std::vector<std::string> users;
- using namespace od;
- auto node = HtmlNode::parseString( fileReadText("centauri_followers.html") );
- HtmlNode* root = node->findRec("div", "class", "GridTimeline-items");
- for(auto& n: root->childs())
- {
- for(auto& n2: n->childs())
- {
- HtmlNode* n3 = n2->findRec("a");
- users.push_back(n3->findAttribute("href"));
- }
- }
- FILE* f = fopen("centauri_followers.txt", "w");
- for(auto& user: users)
- fprintf(f, "%s\n", user.c_str());
- fclose(f);
- return 0;
- }
Add Comment
Please, Sign In to add comment