From 509703a0ad3f1b9b337d6c202c80c6b8da4db7ca Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 26 Feb 2018 18:17:36 -0500 Subject: [PATCH] strip hrefs Signed-off-by: Kenneth Reitz --- requests_html.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requests_html.py b/requests_html.py index 70cbb61..a2e7b93 100644 --- a/requests_html.py +++ b/requests_html.py @@ -120,7 +120,7 @@ class BaseParser: for link in self.find('a'): try: - href = link.attrs['href'] + href = link.attrs['href'].strip() if not href.startswith('#') and self.skip_anchors and href not in ['javascript:;']: yield href except KeyError: