scrapy/w3lib

Python library of web-related functions

HTML

418

838 commits

updated Oct 10, 2026

See the code

README

=====
w3lib
=====

.. image:: https://github.com/scrapy/w3lib/actions/workflows/test.yml/badge.svg
   :target: https://github.com/scrapy/w3lib/actions/workflows/test.yml

.. image:: https://img.shields.io/codecov/c/github/scrapy/w3lib/master.svg
   :target: https://codecov.io/github/scrapy/w3lib?branch=master
   :alt: Coverage report


Overview
========

This is a Python library of web-related functions, such as:

* remove comments, or tags from HTML snippets
* extract base url from HTML snippets
* translate entities on HTML strings
* convert raw HTTP headers to dicts and vice-versa
* construct HTTP auth header
* converting HTML pages to unicode
* sanitize urls (like browsers do)
* extract arguments from urls

Requirements
============

Python 3.11+

Install
=======

``pip install w3lib``

Documentation
=============

See https://w3lib.readthedocs.io/

License
=======

The w3lib library is licensed under the BSD license.

Not written in Markdown, so it's shown here as plain text — view it formatted on GitHub.

hacktoberfest
python

scrapy/w3lib

Python library of web-related functions

HTML

418

838 commits

updated Oct 10, 2026

See the code

README

=====
w3lib
=====

.. image:: https://github.com/scrapy/w3lib/actions/workflows/test.yml/badge.svg
   :target: https://github.com/scrapy/w3lib/actions/workflows/test.yml

.. image:: https://img.shields.io/codecov/c/github/scrapy/w3lib/master.svg
   :target: https://codecov.io/github/scrapy/w3lib?branch=master
   :alt: Coverage report


Overview
========

This is a Python library of web-related functions, such as:

* remove comments, or tags from HTML snippets
* extract base url from HTML snippets
* translate entities on HTML strings
* convert raw HTTP headers to dicts and vice-versa
* construct HTTP auth header
* converting HTML pages to unicode
* sanitize urls (like browsers do)
* extract arguments from urls

Requirements
============

Python 3.11+

Install
=======

``pip install w3lib``

Documentation
=============

See https://w3lib.readthedocs.io/

License
=======

The w3lib library is licensed under the BSD license.

Not written in Markdown, so it's shown here as plain text — view it formatted on GitHub.

hacktoberfest
python

Project health

Overall

6.9/10

Maintained

10/10

Code review

9/10
OpenSSF Scorecard

PyPI

Latest release

2.5.0 · Sep 30, 2026

Releases this year

3

Significant stargazers

Kevin Deldycke

2,207 followers · starred Dec 2022