Giter Club home page Giter Club logo

Comments (5)

lipoja avatar lipoja commented on May 26, 2024

Thank you for that detailed report. I will have a look on it.

from urlextract.

lipoja avatar lipoja commented on May 26, 2024

This issue is fixed in version 0.13.0

from urlextract.

warezers avatar warezers commented on May 26, 2024

I updated version 0.13.0 but I get the same error

from urlextract import URLExtract
extractor = URLExtract()
urls_unique = set()
files = "/Users/roc/Desktop/WEB_000.w3c"
with open(files, 'r', encoding='utf-8') as f:
    for line in f:
        urls = extractor.find_urls(line, only_unique=True)
        urls_unique |= set(urls)
print(urls_unique)
Traceback (most recent call last):
  File "/Users/roc/PycharmProjects/implace/testrun.py", line 657, in <module>
    for url in extractor.find_urls(line):
  File "/Users/roc/Library/Python/3.6/lib/python/site-packages/urlextract/urlextract_core.py", line 636, in find_urls
    return list(urls)
  File "/Users/roc/Library/Python/3.6/lib/python/site-packages/urlextract/urlextract_core.py", line 598, in gen_urls
    tmp_url = self._complete_url(text, offset + tld_pos, tld)
  File "/Users/roc/Library/Python/3.6/lib/python/site-packages/urlextract/urlextract_core.py", line 376, in _complete_url
    if not self._is_domain_valid(complete_url, tld):
  File "/Users/roc/Library/Python/3.6/lib/python/site-packages/urlextract/urlextract_core.py", line 483, in _is_domain_valid
    host_parts = host.split('.')
AttributeError: 'IPv4Address' object has no attribute 'split'

from urlextract.

lipoja avatar lipoja commented on May 26, 2024

@warezers Could you double check that you are running version 0.13.0? Because from the Traceback I see that it failed on line 483 on host.split('.'). But in latest version the line 483 is empty.

from urlextract.

warezers avatar warezers commented on May 26, 2024

@lipoja yes, new update version is working
thank you

from urlextract.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.