mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-27 15:58:06 -05:00
Fixed a bug if the <head> isn't in the first 1kb.
This commit is contained in:
committed by
Neil Williams
parent
4f1a5fdf19
commit
847ee8ffec
@@ -225,7 +225,7 @@ def get_title(url):
|
||||
def extract_title(data):
|
||||
"""Tries to extract the value of the title element from a string of HTML"""
|
||||
bs = BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
|
||||
if not bs:
|
||||
if not bs or not bs.html.head:
|
||||
return
|
||||
|
||||
title_bs = bs.html.head.title
|
||||
|
||||
Reference in New Issue
Block a user