URLExtract is python class for collecting (extracting) URLs from given
.. image:: https://img.shields.io/travis/lipoja/URLExtract/master.svg
:alt: Build Status
.. image:: https://img.shields.io/github/tag/lipoja/URLExtract.svg
:alt: Git tag
.. image:: https://img.shields.io/pypi/pyversions/urlextract.svg
:alt: Python Version Compatibility
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
NOTE: List of TLDs is downloaded from iana.org to keep you up to date with new TLDs.
Package is available on PyPI - you can install it via pip.
.. image:: https://img.shields.io/pypi/v/urlextract.svg
.. image:: https://img.shields.io/pypi/status/urlextract.svg
pip install urlextract
Online documentation is published at http://urlextract.readthedocs.io/
- IDNA for converting links to IDNA format
- uritools for domain name validation
pip install idna
pip install uritools
You can look at command line program *bin/urlextract*.
But everything you need to know is this:
.. code:: python
from urlextract import URLExtract
extractor = URLExtract()
urls = extractor.find_urls("Text with URLs. Let's have URL janlipovsky.cz as an example.")
print(urls) # prints: ['janlipovsky.cz']
This piece of code is licensed under The MIT License.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.