Work around for poorly formatted desc on adastra. Saw error in logs.

This commit is contained in:
Jim Miller 2011-10-27 15:00:33 -05:00
parent 33e520fef1
commit 141ed90d74
2 changed files with 5 additions and 2 deletions

View file

@ -1,6 +1,6 @@
# fanfictionloader ffd-retief
application: fanfictionloader
version: 4-0-6
version: 4-0-7
runtime: python
api_version: 1

View file

@ -122,9 +122,12 @@ class AdAstraFanficComSiteAdapter(BaseSiteAdapter):
if 'Summary' in label:
## Everything until the next span class='label'
svalue = ''
while not defaultGetattr(value,'class') == 'label':
while value and not defaultGetattr(value,'class') == 'label':
svalue += str(value)
value = value.nextSibling
# sometimes poorly formated desc (<p> w/o </p>) leads
# to all labels being included.
svalue=svalue[:svalue.find('<span class="label">')]
self.story.setMetadata('description',stripHTML(svalue))
if 'Rated' in label: