Skip to main content

Collects and extracts URLs from given text.

Project description

URLExtract is python class for collecting (extracting) URLs from given text.

How does it work

It tries to find any occurrence of TLD in given text. If TLD is found it starts from that position to expand boundaries to both sides searching for “stop character” (usually whitespace, comma, single or double quote).

NOTE: List of TLDs is downloaded from to keep you up to date with new TLDs.


Package is available on PyPI - you can install it via pip.

pip install urlextract


Online documentation is published at


  • IDNA for converting links to IDNA format

  • uritools for

    pip install idna
    pip install uritools


You can look at command line program bin/urlextract. But everything you need to know is this:

from urlextract import URLExtract

extractor = URLExtract()
urls = extractor.find_urls("Text with URLs. Let's have URL as an example.")
print(urls) # prints: ['']


This piece of code is licensed under The MIT License.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for urlextract, version 0.3
Filename, size File type Python version Upload date Hashes
Filename, size urlextract-0.3.tar.gz (5.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page