Skip to content

Enhance the structure returned from the dictionary #17

Description

@aimtsou

Good morning,

You could enhance the dictionary structure by providing 3 more elements:

  • fqdn: Which is a mapping of subdomain.domain.suffix
  • registered domain: which is a mapping of domain.suffix
  • one mapping for subdomain.domain (which would resolve the ip case issue)

Activity

  1. wavenator commented on Jun 25, 2023

    @wavenator
    Contributor

    Hi @aimtsou! Thanks for opening an issue.

    Could you please provide further details regarding your idea? Could you also include a code snippet that explains the use case and demonstrates how your proposal can be utilized?

    Let me confirm if I understand correctly. Are you suggesting that the "extract" call should return a dictionary with the mentioned attributes, where the "fqdn" attribute represents the concatenated string of all the parts of the domain?

  2. faux-peter commented on Mar 17, 2026

    @faux-peter

    Kinda like the idea only inasmuch as when you scrape a page and want to verify a href to an external site.

    How I do it now. Maybe I'm missing something obvious here?

    ext = domain_extractor.extract_from_url('http://www.google.com")' 'is_valid = is_valid_domain(f"{ext['domain']}.{ext['suffix']}")

    or automatically grab the domain and suffix

    valid_domain = domain_extractor.is_valid_domain(ext)

    or and I think this makes the most sense to me.

    `ext = domain_extract.extract_from_url('http://www.google.com", validate=True)'

    'print(ext{'valid_domain') `

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions