Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with URL https://www.commercecentric.com causes no valid icons to be returned #31

Open
advance512 opened this issue Jun 17, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@advance512
Copy link

Though there are some valid icons, none are returned. Instead, this error is thrown:

Traceback (most recent call last):
  File "/src/logic/website_scraping.py", line 312, in getWebsiteScrapedDataForURL
    potentialIcons = favicon.get(
  File "/.venv/lib/python3.8/site-packages/favicon/favicon.py", line 66, in get
    link_icons = tags(response.url, response.text)
  File "/.venv/lib/python3.8/site-packages/favicon/favicon.py", line 142, in tags
    width, height = dimensions(tag)
  File "/.venv/lib/python3.8/site-packages/favicon/favicon.py", line 176, in dimensions
    width, height = re.split(r'[x\xd7]', size[0])
ValueError: not enough values to unpack (expected 2, got 1)

size is an array with contents: ['32/32'].

@scottwernervt scottwernervt added the bug Something isn't working label Jun 17, 2020
@scottwernervt
Copy link
Owner

The code is looking for <width>x<height>, e.g. 32x32, so we just need to update width, height = re.split(r'[x\xd7]', size[0]) to support /.

@advance512
Copy link
Author

Pull request #32 should fix this, and add support for passing in HTML input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants