diff --git a/fanficfare/adapters/adapter_adultfanfictionorg.py b/fanficfare/adapters/adapter_adultfanfictionorg.py index 417e0d13..4f47e7bd 100644 --- a/fanficfare/adapters/adapter_adultfanfictionorg.py +++ b/fanficfare/adapters/adapter_adultfanfictionorg.py @@ -171,7 +171,7 @@ class AdultFanFictionOrgAdapter(BaseSiteAdapter): # params['submit'] = 'Login' # # copy all hidden input tags to pick up appropriate tokens. - # for tag in soup.findAll('input',{'type':'hidden'}): + # for tag in soup.find_all('input',{'type':'hidden'}): # params[tag['name']] = tag['value'] # logger.debug("Will now login to URL {0} as {1} with password: {2}".format(url, params['email'],params['pass1'])) @@ -218,7 +218,7 @@ class AdultFanFictionOrgAdapter(BaseSiteAdapter): # Find the chapters: chapters = soup.find('ul',{'class':'dropdown-content'}) - for i, chapter in enumerate(chapters.findAll('a')): + for i, chapter in enumerate(chapters.find_all('a')): self.add_chapter(chapter,self.url+'&chapter='+unicode(i+1)) @@ -262,7 +262,7 @@ class AdultFanFictionOrgAdapter(BaseSiteAdapter): pages = 0 pagination=asoup.find('ul',{'class' : 'pagination'}) if pagination: - pages = pagination.findAll('li')[-1].find('a') + pages = pagination.find_all('li')[-1].find('a') if not pages == None: pages = pages['href'].split('=')[-1] else: @@ -271,7 +271,7 @@ class AdultFanFictionOrgAdapter(BaseSiteAdapter): storya = None ##If there is only 1 page of stories, check it to get the Metadata, if pages == 0: - a = asoup.findAll('li') + a = asoup.find_all('li') for lc2 in a: if lc2.find('a', href=re.compile(r'story.php\?no='+self.story.getMetadata('storyId')+"$")): storya = lc2 @@ -294,7 +294,7 @@ class AdultFanFictionOrgAdapter(BaseSiteAdapter): # we look for the li element that has the story here asoup = self.make_soup(adata) - a = asoup.findAll('li') + a = asoup.find_all('li') for lc2 in a: if lc2.find('a', href=re.compile(r'story.php\?no='+self.story.getMetadata('storyId')+"$")): i=1 diff --git a/fanficfare/adapters/adapter_asexstoriescom.py b/fanficfare/adapters/adapter_asexstoriescom.py index 577be2ef..77c5e3f1 100644 --- a/fanficfare/adapters/adapter_asexstoriescom.py +++ b/fanficfare/adapters/adapter_asexstoriescom.py @@ -92,7 +92,7 @@ class ASexStoriesComAdapter(BaseSiteAdapter): self.story.setMetadata('title', title.string) # Author - author = soup1.find('div',{'class':'story-info'}).findAll('div',{'class':'story-info-bl'})[1].find('a') + author = soup1.find('div',{'class':'story-info'}).find_all('div',{'class':'story-info-bl'})[1].find('a') authorurl = author['href'] self.story.setMetadata('author', author.string) self.story.setMetadata('authorUrl', authorurl) @@ -112,7 +112,7 @@ class ASexStoriesComAdapter(BaseSiteAdapter): ### add it before the rest of the pages, if any self.add_chapter('1', self.url) - chapterTable = soup1.find('div',{'class':'pages'}).findAll('a') + chapterTable = soup1.find('div',{'class':'pages'}).find_all('a') if chapterTable is not None: # Multi-chapter story @@ -124,7 +124,7 @@ class ASexStoriesComAdapter(BaseSiteAdapter): self.add_chapter(chapterTitle, chapterUrl) - rated = soup1.find('div',{'class':'story-info'}).findAll('div',{'class':'story-info-bl5'})[0].find('img')['title'].replace('- Rate','').strip() + rated = soup1.find('div',{'class':'story-info'}).find_all('div',{'class':'story-info-bl5'})[0].find('img')['title'].replace('- Rate','').strip() self.story.setMetadata('rating',rated) self.story.setMetadata('dateUpdated', makeDate('01/01/2001', '%m/%d/%Y')) diff --git a/fanficfare/adapters/adapter_ashwindersycophanthexcom.py b/fanficfare/adapters/adapter_ashwindersycophanthexcom.py index b7646d85..daeb4f4a 100644 --- a/fanficfare/adapters/adapter_ashwindersycophanthexcom.py +++ b/fanficfare/adapters/adapter_ashwindersycophanthexcom.py @@ -136,14 +136,14 @@ class AshwinderSycophantHexComAdapter(BaseSiteAdapter): try: # in case link points somewhere other than the first chapter - a = soup.findAll('option')[1]['value'] + a = soup.find_all('option')[1]['value'] self.story.setMetadata('storyId',a.split('=',)[1]) url = 'http://'+self.host+'/'+a soup = self.make_soup(self.get_request(url)) except: pass - for info in asoup.findAll('table', {'width' : '100%', 'bordercolor' : re.compile(r'#')}): + for info in asoup.find_all('table', {'width' : '100%', 'bordercolor' : re.compile(r'#')}): a = info.find('a', href=re.compile(r'viewstory.php\?sid='+self.story.getMetadata('storyId')+"$")) if a != None: self.story.setMetadata('title',stripHTML(a)) @@ -151,7 +151,7 @@ class AshwinderSycophantHexComAdapter(BaseSiteAdapter): # Find the chapters: - chapters=soup.findAll('a', href=re.compile(r'viewstory.php\?sid=\d+&i=1$')) + chapters=soup.find_all('a', href=re.compile(r'viewstory.php\?sid=\d+&i=1$')) if len(chapters) == 0: self.add_chapter(self.story.getMetadata('title'),url) else: @@ -170,7 +170,7 @@ class AshwinderSycophantHexComAdapter(BaseSiteAdapter): except: return "" - cats = info.findAll('a',href=re.compile('categories.php')) + cats = info.find_all('a',href=re.compile('categories.php')) for cat in cats: self.story.addToList('category',cat.string) @@ -188,7 +188,7 @@ class AshwinderSycophantHexComAdapter(BaseSiteAdapter): ## Published: 04/08/2007 ## one story had Updated... in the description. Restrict to sub-table - labels = info.find('table').findAll('b') + labels = info.find('table').find_all('b') for labelspan in labels: value = labelspan.nextSibling label = stripHTML(labelspan) diff --git a/fanficfare/adapters/adapter_asianfanficscom.py b/fanficfare/adapters/adapter_asianfanficscom.py index 5a0ad5fe..6bbcb94d 100644 --- a/fanficfare/adapters/adapter_asianfanficscom.py +++ b/fanficfare/adapters/adapter_asianfanficscom.py @@ -147,7 +147,7 @@ class AsianFanFicsComAdapter(BaseSiteAdapter): # Find authorid and URL from... author url. mainmeta = soup.find('footer', {'class': 'main-meta'}) alist = mainmeta.find('span', string='Author(s)') - alist = alist.parent.findAll('a', href=re.compile(r"/profile/u/[^/]+")) + alist = alist.parent.find_all('a', href=re.compile(r"/profile/u/[^/]+")) for a in alist: self.story.addToList('authorId',a['href'].split('/')[-1]) self.story.addToList('authorUrl','https://'+self.host+a['href']) @@ -159,10 +159,10 @@ class AsianFanFicsComAdapter(BaseSiteAdapter): chapters=soup.find('select',{'name':'chapter-nav'}) hrefattr=None if chapters: - chapters=chapters.findAll('option') + chapters=chapters.find_all('option') hrefattr='value' else: # didn't find