From e29f6b9a723234bb6265532d2392534d02437180 Mon Sep 17 00:00:00 2001 From: Roger Philibert Date: Tue, 20 Apr 2010 23:52:28 +0200 Subject: [PATCH] add strip() to parsed elements --- weboob/backends/youporn/pages/index.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/weboob/backends/youporn/pages/index.py b/weboob/backends/youporn/pages/index.py index c76bf490..699c8e56 100644 --- a/weboob/backends/youporn/pages/index.py +++ b/weboob/backends/youporn/pages/index.py @@ -43,14 +43,14 @@ class IndexPage(PornPage): url = a.attrib['href'] _id = url[len('/watch/'):] _id = _id[:_id.find('/')] - title = a.text + title = a.text.strip() duration = 0 div = li.cssselect('div[class=duration_views]') if div: h2 = div[0].find('h2') - duration = 60 * int(h2.text) - duration += int(h2.find('span').tail) + duration = 60 * int(h2.text.strip()) + duration += int(h2.find('span').tail.strip()) rating = 0 rating_max = 0 @@ -59,6 +59,7 @@ class IndexPage(PornPage): p = div[0].find('p') rating = float(p.text.strip()) rating_max = float(p.find('span').text.strip()[2:]) + yield Video(int(_id), title, rating=rating,