email-scraper
Advanced tools
| Metadata-Version: 1.1 | ||
| Name: email-scraper | ||
| Version: 0.2 | ||
| Version: 0.3 | ||
| Summary: Simple utility to extract email addresses from HTML, including obfuscated email addresses | ||
@@ -18,3 +18,3 @@ Home-page: https://github.com/kichik/email-scraper | ||
| .. _PyPI: https://pypi.python.org/pypi/email-scraper/ | ||
| .. _PyPI: https://pypi.org/pypi/email-scraper/ | ||
@@ -21,0 +21,0 @@ .. image:: https://travis-ci.org/kichik/email-scraper.svg?branch=master |
| README.rst | ||
| setup.cfg | ||
| setup.py | ||
@@ -3,0 +4,0 @@ email_scraper/__init__.py |
@@ -12,7 +12,26 @@ import base64 | ||
| HIDDEN_AT_SYM = (" (at) ", " [at] ", " (@) ", " [@] ", " @ ") | ||
| HIDDEN_DOT_SYM = (" (dot) ", " [dot] ", " (.) ", " [.] ", " . ") | ||
| HIDDEN_REGEX = [ | ||
| '(\w+({0})\w+({1})\w+)'.format( | ||
| at.replace("(", r"\(").replace(")", r"\)").replace("[", r"\[").replace("]", r"\]"), | ||
| dot.replace("(", r"\(").replace(")", r"\)").replace("[", r"\[").replace("]", r"\]"), | ||
| ) | ||
| for at, dot in zip(HIDDEN_AT_SYM, HIDDEN_DOT_SYM) | ||
| ] | ||
| def extract_emails(text): | ||
| return re.findall(EMAIL_REGEX, text) | ||
| def unhide_email(hidden_email): | ||
| for at_sym in HIDDEN_AT_SYM: | ||
| hidden_email = hidden_email.replace(at_sym, "@") | ||
| for dot_sym in HIDDEN_DOT_SYM: | ||
| hidden_email = hidden_email.replace(dot_sym, ".") | ||
| return hidden_email | ||
| hidden = [] | ||
| for expr in HIDDEN_REGEX: | ||
| hidden += [unhide_email(i[0]) for i in re.findall(expr, text)] | ||
| return re.findall(EMAIL_REGEX, text) + hidden | ||
| def deobfuscate_html(html): | ||
@@ -19,0 +38,0 @@ def unescape(html_text): |
+2
-2
| Metadata-Version: 1.1 | ||
| Name: email-scraper | ||
| Version: 0.2 | ||
| Version: 0.3 | ||
| Summary: Simple utility to extract email addresses from HTML, including obfuscated email addresses | ||
@@ -18,3 +18,3 @@ Home-page: https://github.com/kichik/email-scraper | ||
| .. _PyPI: https://pypi.python.org/pypi/email-scraper/ | ||
| .. _PyPI: https://pypi.org/pypi/email-scraper/ | ||
@@ -21,0 +21,0 @@ .. image:: https://travis-ci.org/kichik/email-scraper.svg?branch=master |
+1
-1
@@ -10,3 +10,3 @@ #################################################### | ||
| .. _PyPI: https://pypi.python.org/pypi/email-scraper/ | ||
| .. _PyPI: https://pypi.org/pypi/email-scraper/ | ||
@@ -13,0 +13,0 @@ .. image:: https://travis-ci.org/kichik/email-scraper.svg?branch=master |
+3
-0
@@ -0,1 +1,4 @@ | ||
| [bdist_wheel] | ||
| universal = 1 | ||
| [egg_info] | ||
@@ -2,0 +5,0 @@ tag_build = |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
7868
11.9%86
26.47%