Skip to content

c++ library to provide jQuery style api for gumbo library

License

Notifications You must be signed in to change notification settings

Falven/cpp-gumbo-query

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gumbo-query

A C++ library that provides jQuery-like selectors for Google's Gumbo-Parser.

Selector engine is an implementation based on cascadia.

Installation

2 ways:

Through homebrew (Recommended):

$ brew install gumbo-query

Through git:

$ git clone https://github.com/Falven/gumbo-query
$ cd gumbo-query/build && cmake .. && make && make test
$ sudo make install

And to generate Doxygen documentation:

$ make doc

Usage

#include <iostream>
#include <string>
#include "Document.h"
#include "Node.h"

int main(int argc, char * argv[])
{
  std::string page("<h1><a>some link</a></h1>");
  CDocument doc;
  doc.parse(page.c_str());

  CSelection c = doc.find("h1 a");
  std::cout << c.nodeAt(0).text() << std::endl; // some link
  return 0;
}

About

c++ library to provide jQuery style api for gumbo library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 46.0%
  • HTML 19.2%
  • CMake 17.8%
  • Makefile 14.1%
  • Shell 2.4%
  • Ruby 0.5%