Skip to content


MIT 12 1 675
58.1 thousand (month) Feb 07 2019 v1.3.0(1 year, 25 days ago)
13,506 2 210 MIT
0.10.0(5 years ago) Feb 25 2018 681.6 thousand (month)

htmlquery is a Go library that allows you to parse and extract data from HTML documents using XPath expressions. It provides a simple and intuitive API for traversing and querying the HTML tree structure, and it is built on top of the popular Goquery library.

requests-html is a Python package that allows you to easily make HTTP requests and parse the HTML content of web pages. It is built on top of the popular requests package and uses the html parser from the lxml library, which makes it fast and efficient. This package is designed to provide a simple and convenient API for web scraping, and it supports features such as JavaScript rendering, CSS selectors, and form submissions.

It also offers a lot of functionalities such as cookie, session, and proxy support, which makes it an easy-to-use package for web scraping and web automation tasks.

In short requests-html offers:

  • Full JavaScript support!
  • CSS Selectors (a.k.a jQuery-style, thanks to PyQuery).
  • XPath Selectors, for the faint of heart.
  • Mocked user-agent (like a real web browser).
  • Automatic following of redirects.
  • Connection–pooling and cookie persistence.
  • The Requests experience you know and love, with magical parsing abilities.
  • Async Support

Example Use

package main

import (


func main() {
  // Parse the HTML string
  doc, err := htmlquery.Parse([]byte(`
        <h1>Hello, World!</h1>
          <li>Item 1</li>
          <li>Item 2</li>
          <li>Item 3</li>
  if err != nil {

  // Extract the text of the first <h1> element
  h1 := htmlquery.FindOne(doc, "//h1")
  fmt.Println(htmlquery.InnerText(h1)) // "Hello, World!"

  // Extract the text of all <li> elements
  lis := htmlquery.Find(doc, "//li")
  for _, li := range lis {
  // "Item 1"
  // "Item 2"
  // "Item 3"
from requests_html import HTMLSession

session = HTMLSession()
r = session.get('')

# print the HTML content of the page

# use CSS selectors to find specific elements on the page
title = r.html.find('title', first=True)

Alternatives / Similar