From d55bcfb34f58361fdaa043b6c5528f39fd193d2b Mon Sep 17 00:00:00 2001 From: shaunpud Date: Sun, 11 Mar 2018 19:53:54 +0800 Subject: [PATCH] Shorten --- requests_html.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requests_html.py b/requests_html.py index 092fb2b..8435209 100644 --- a/requests_html.py +++ b/requests_html.py @@ -294,7 +294,7 @@ class BaseParser: try: href = link.attrs['href'].strip() - if href and not (href.startswith('#') and self.skip_anchors) and not href.startswith('javascript:') and not href.startswith('mailto:'): + if href and not (href.startswith('#') and self.skip_anchors) and not href.startswith(('javascript:', 'mailto:')): yield href except KeyError: pass