phillipsm / pyfav Goto Github PK
View Code? Open in Web Editor NEWpyfav is a simple Python library that helps you get a favicon for a supplied URL.
pyfav is a simple Python library that helps you get a favicon for a supplied URL.
In [1]: import pyfav
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-1cc423f5c22f> in <module>()
----> 1 import pyfav
~/anaconda3/envs/url/lib/python3.5/site-packages/pyfav/__init__.py in <module>()
----> 1 from pyfav import get_favicon_url
2 from pyfav import parse_markup_for_favicon
3 from pyfav import download_favicon
ImportError: cannot import name 'get_favicon_url'
I'm handling a yahoo RSS stream with urls like this:
Using get_favicon_url(), I always get the yahoo icon, not the other one.
But browsing to that URL I go to the second one.
When I look with curl, I see a 302 redirect.
Dont recongnize URL when SSL Fail.
Plase add ",verify=False)" on both requests.get. (Line 171 and 187)
Some sites have multiple sizes of favicons, but on a site that has 16-, 32-, and 64-px favicons, this picked the 16-px one.
Would be nice to have Python3 support.
I've been able to use pyfav via 2to3 conversion.
Here is the output of the conversion:
2to3 -w pyfav.py
RefactoringTool: Skipping optional fixer: buffer
RefactoringTool: Skipping optional fixer: idioms
RefactoringTool: Skipping optional fixer: set_literal
RefactoringTool: Skipping optional fixer: ws_comma
RefactoringTool: Refactored pyfav.py
--- pyfav.py (original)
+++ pyfav.py (refactored)
@@ -33,8 +33,8 @@
-import urllib, os.path, string
-from urlparse import urlparse
+import urllib.request, urllib.parse, urllib.error, os.path, string
+from urllib.parse import urlparse
import requests
from bs4 import BeautifulSoup
RefactoringTool: Files that were modified:
RefactoringTool: pyfav.py
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.