mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2025-12-22 08:44:13 +01:00
More stripping \xa0 in adapters.
This commit is contained in:
parent
49f78457ee
commit
01c836f236
5 changed files with 6 additions and 6 deletions
|
|
@ -133,7 +133,7 @@ class FireFlyFansNetSiteAdapter(BaseSiteAdapter):
|
|||
# which is usualy FireFly on this site, but I'm going to get them
|
||||
# anyway.a
|
||||
category = soup.find('span', {'id': 'MainContent_txtItemDetails'})
|
||||
category = stripHTML(unicode(category).replace(u"\xc2\xa0", ' '))
|
||||
category = stripHTML(unicode(category).replace(u"\xa0", u' '))
|
||||
metad = category.split(' ')
|
||||
for meta in metad:
|
||||
if ":" in meta:
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ class FireflyPopulliOrgSiteAdapter(BaseSiteAdapter):
|
|||
# There alot of nbsp's (non broken spaces) in here, so I'm going to remove them
|
||||
# I'm also getting rid of the bold tags and the nextline characters to make it
|
||||
# easier to get the information below
|
||||
story = repr(story).replace(b'\\xa0', '').replace(' ',' ').replace(
|
||||
story = repr(story).replace(u'\\xa0', '').replace(' ',' ').replace(
|
||||
'<b>','').replace('</b>','').replace(r'\n','')
|
||||
story = self.make_soup(story).find('p')
|
||||
story_a = story.find('a')
|
||||
|
|
@ -319,7 +319,7 @@ class FireflyPopulliOrgSiteAdapter(BaseSiteAdapter):
|
|||
# the end of the section, which has alot of extraneous things, then adding my own div
|
||||
# wrapper, recreating the soup, then getting that div from the soup again, before sending to
|
||||
# the writers.
|
||||
story = repr(story).replace(b'\\xa0', '').replace(' ',' ').replace(r'\n','').strip()
|
||||
story = repr(story).replace(u'\\xa0', '').replace(' ',' ').replace(r'\n','').strip()
|
||||
story = story[12:]
|
||||
story = story[:story.find('<p align="center" class="comments">Please <')]
|
||||
story = '<div class="chaptertext">' + story + '</div>'
|
||||
|
|
|
|||
|
|
@ -286,7 +286,7 @@ class LOTRgficComAdapter(BaseSiteAdapter):
|
|||
#<br/>
|
||||
#</p>
|
||||
## we'll have to remove the non-breaking spaces to get this to work.
|
||||
metad = unicode(metad).replace(u"\xc2\xa0",'').replace('\n','')
|
||||
metad = unicode(metad).replace(u"\xa0",'').replace('\n','')
|
||||
for txt in metad.split('<br/>'):
|
||||
if 'Challenges:' in txt:
|
||||
txt = txt.replace('Challenges:','').strip()
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ class WWWArea52HKHNetAdapter(BaseSiteAdapter):
|
|||
|
||||
## I've seen a non-breaking space in some of the storyblocks
|
||||
## so we are going to remove them.
|
||||
series = stripHTML(unicode(series.renderContents()).replace(u"\xc2\xa0",'')).strip()
|
||||
series = stripHTML(unicode(series.renderContents()).replace(u"\xa0",'')).strip()
|
||||
if len(series) > 0:
|
||||
self.story.setMetadata('series',series)
|
||||
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ class WWWUtopiastoriesComAdapter(BaseSiteAdapter):
|
|||
|
||||
|
||||
for detail in soup.findAll('li'):
|
||||
det = unicode(detail).replace(u"\xc2\xa0",'')
|
||||
det = unicode(detail).replace(u"\xa0",'')
|
||||
heading = stripHTML(det).split(' - ')[0]
|
||||
text = stripHTML(det).replace(heading+' - ','')
|
||||
if 'Author' in heading:
|
||||
|
|
|
|||
Loading…
Reference in a new issue