goquery brings a syntax and a set of features similar to jQuery to the Go language. It is based on Go's net/HTML package and the CSS Selector library Cascadia. Since the net/html parser returns nodes, and not a full-featured DOM tree, jQuery's stateful manipulation functions (like height(), css(), and detach()) have been left off. Also, because the net/HTML parser requires UTF-8 encoding, so does goquery: it is the caller's responsibility to ensure that the source document provides UTF-8 encoded HTML. See the wiki for various options to do this. Syntax-wise, it is as close as possible to jQuery, with the same function names when possible, and that warm and fuzzy chainable interface. jQuery being the ultra-popular library that it is, I felt that writing a similar HTML-manipulating library was better to follow its API than to start anew (in the same spirit as Go's fmt package), even though some of its methods are less than intuitive (looking at you, index()...).

Features

  • See some tips and tricks in the wiki
  • Licensed under the BSD license
  • goquery exposes two structs, Document and Selection
  • Syntax-wise, it is as close as possible to jQuery
  • goquery brings a syntax and a set of features similar to jQuery to the Go language
  • It is based on Go's net/html package and the CSS Selector library cascadia.

Project Samples

Project Activity

See All Activity >

Categories

Libraries

License

BSD License

Follow goquery

goquery Web Site

Other Useful Business Software
Orchestrate Your AI Agents with Zenflow Icon
Orchestrate Your AI Agents with Zenflow

The multi-agent workflow engine for modern teams. Zenflow executes coding, testing, and verification with deep repo awareness

Zenflow orchestrates AI agents like a real engineering system. With parallel execution, spec-driven workflows, and deep multi-repo understanding, agents plan, implement, test, and verify end-to-end. Upgrade to AI workflows that work the way your team does.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of goquery!

Additional Project Details

Programming Language

Go

Related Categories

Go Libraries

Registered

2023-09-20