Coder Social home page Coder Social logo

gumboquery's Introduction

GumboQuery

GumboPlus is an implementation of python of Gumbo to provide rich operate interface for parse html5 tag data.

Requirements

Install Gubmo

1. git clone https://github.com/google/gumbo-parser.git      
2. ./autogen.sh 
3. ./configure      
4. make 
5. sudo make install    

To install the python bindings

1. sudo python setup.py install
2. sudo pip install BeautifulSoup

Example

from lib.GetElement import GumboQuery
q = GumboQuery('<div><a>123</a><div class="gg">gg</div><div id="dd">dd</div></div>')
or 
q = GumboQuery('http://www.google.com')
or 
q = GumboQuery('test.html')

You can do 
q.query('div') // query element
q.query('.gg') // query class
q.query('#dd') // query id
q.query('div[title=gumbo]') // query attrs title of div is gumbo

// set url to parse 
q.setUrl("http://www.google.com")
// set HTML source 
q.setHtml("<div><h1>333</h1></div>")
// set HTML file
q.setFile('test.html')

Contact

If you have found a bug or a question, email me at [email protected]

gumboquery's People

Contributors

cartertsai avatar

Watchers

Sardor Muminov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.