From 7b63730e2b18c49e8241e27e3a3e96c198b96a5f Mon Sep 17 00:00:00 2001 From: Chyroc Date: Mon, 26 Feb 2018 10:50:43 +0800 Subject: [PATCH] fix https://github.com/kennethreitz/requests-html/issues/10 : links contain javascript:; --- requests_html.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requests_html.py b/requests_html.py index a4c6d47..406f587 100644 --- a/requests_html.py +++ b/requests_html.py @@ -136,7 +136,7 @@ class HTML: for link in self.find('a'): try: href = link.attrs['href'] - if not href.startswith('#') and self.skip_anchors: + if not href.startswith('#') and self.skip_anchors and href not in ['javascript:;']: yield href except KeyError: pass