From eeedbdba8692f7cffc534db86177bac1fdc41665 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 26 Feb 2018 18:18:28 -0500 Subject: [PATCH] strip attrs 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 a2e7b93..6f4cce8 100644 --- a/requests_html.py +++ b/requests_html.py @@ -184,7 +184,7 @@ class Element(BaseParser): @property def attrs(self): """Returns a dictionary of the attributes of the element.""" - attrs = {k: self.pq.attr[k] for k in self.element.keys()} + attrs = {k: self.pq.attr[k].strip() for k in self.element.keys()} # Split class up, as there are ussually many of them: if 'class' in attrs: