~stefanor/ibid/jabber-reconnect

« back to all changes in this revision

Viewing changes to ibid/plugins/url.py

  • Committer: Stefano Rivera
  • Date: 2010-01-16 16:15:42 UTC
  • mfrom: (839.1.1 url-507691)
  • Revision ID: stefano@rivera.za.net-20100116161542-qyx6r29ubw2qcz60
Return URL instead of None if etree can't find a title

https://code.launchpad.net/~stefanor/ibid/url-507691/+merge/1746

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
            headers = {'User-Agent': 'Mozilla/5.0'}
104
104
            etree = get_html_parse_tree(url, None, headers, 'etree')
105
105
            title = etree.findtext('head/title')
106
 
            return title
 
106
            return title or url
107
107
        except HTTPError, e:
108
108
            raise
109
109
        except Exception, e: