diff --git a/fanficfare/adapters/adapter_asexstoriescom.py b/fanficfare/adapters/adapter_asexstoriescom.py index 34513737..577be2ef 100644 --- a/fanficfare/adapters/adapter_asexstoriescom.py +++ b/fanficfare/adapters/adapter_asexstoriescom.py @@ -79,7 +79,7 @@ class ASexStoriesComAdapter(BaseSiteAdapter): data1 = self.get_request(self.url) soup1 = self.make_soup(data1) #strip comments from soup - [comment.extract() for comment in soup1.find_all(text=lambda text:isinstance(text, Comment))] + [comment.extract() for comment in soup1.find_all(string=lambda text:isinstance(text, Comment))] if 'Page Not Found.' in data1: raise exceptions.StoryDoesNotExist(self.url) diff --git a/fanficfare/adapters/adapter_asianfanficscom.py b/fanficfare/adapters/adapter_asianfanficscom.py index 9fcdba24..f266bd76 100644 --- a/fanficfare/adapters/adapter_asianfanficscom.py +++ b/fanficfare/adapters/adapter_asianfanficscom.py @@ -146,7 +146,7 @@ class AsianFanFicsComAdapter(BaseSiteAdapter): # Find authorid and URL from... author url. mainmeta = soup.find('footer', {'class': 'main-meta'}) - alist = mainmeta.find('span', text='Author(s)') + alist = mainmeta.find('span', string='Author(s)') alist = alist.parent.findAll('a', href=re.compile(r"/profile/u/[^/]+")) for a in alist: self.story.addToList('authorId',a['href'].split('/')[-1]) @@ -171,9 +171,9 @@ class AsianFanFicsComAdapter(BaseSiteAdapter): # find timestamp - a = soup.find('span', text='Updated') + a = soup.find('span', string='Updated') if a == None: - a = soup.find('span', text='Published') # use published date if work was never updated + a = soup.find('span', string='Published') # use published date if work was never updated a = a.parent.find('time') chapterDate = makeDate(a['datetime'],self.dateformat) if newestChapter == None or chapterDate > newestChapter: @@ -181,7 +181,7 @@ class AsianFanFicsComAdapter(BaseSiteAdapter): self.newestChapterNum = index # story status - a = mainmeta.find('span', text='Completed') + a = mainmeta.find('span', string='Completed') if a: self.story.setMetadata('status', 'Completed') else: @@ -200,30 +200,30 @@ class AsianFanFicsComAdapter(BaseSiteAdapter): self.setDescription(url,a) # story tags - a = mainmeta.find('span',text='Tags') + a = mainmeta.find('span',string='Tags') if a: tags = a.parent.findAll('a') for tag in tags: self.story.addToList('tags', tag.text) # story tags - a = mainmeta.find('span',text='Characters') + a = mainmeta.find('span',string='Characters') if a: self.story.addToList('characters', a.nextSibling) # published on - a = soup.find('span', text='Published') + a = soup.find('span', string='Published') a = a.parent.find('time') self.story.setMetadata('datePublished', makeDate(a['datetime'], self.dateformat)) # updated on - a = soup.find('span', text='Updated') + a = soup.find('span', string='Updated') if a: a = a.parent.find('time') self.story.setMetadata('dateUpdated', makeDate(a['datetime'], self.dateformat)) # word count - a = soup.find('span', text='Total Word Count') + a = soup.find('span', string='Total Word Count') if a: a = a.find_next('span') self.story.setMetadata('numWords', int(a.text.split()[0])) diff --git a/fanficfare/adapters/adapter_bdsmlibrarycom.py b/fanficfare/adapters/adapter_bdsmlibrarycom.py index c90bc57d..6d719aff 100644 --- a/fanficfare/adapters/adapter_bdsmlibrarycom.py +++ b/fanficfare/adapters/adapter_bdsmlibrarycom.py @@ -169,7 +169,7 @@ class BDSMLibraryComSiteAdapter(BaseSiteAdapter): raise exceptions.FailedToDownload("Error downloading Chapter: {0}! Missing required element!".format(url)) #strip comments from soup - [comment.extract() for comment in chaptertag.findAll(text=lambda text:isinstance(text, Comment))] + [comment.extract() for comment in chaptertag.findAll(string=lambda text:isinstance(text, Comment))] # BDSM Library basically wraps it's own html around the document, # so we will be removing the script, title and meta content from the diff --git a/fanficfare/adapters/adapter_bloodshedversecom.py b/fanficfare/adapters/adapter_bloodshedversecom.py index 0287a41d..0e06ba23 100644 --- a/fanficfare/adapters/adapter_bloodshedversecom.py +++ b/fanficfare/adapters/adapter_bloodshedversecom.py @@ -117,7 +117,7 @@ class BloodshedverseComAdapter(BaseSiteAdapter): summary_div = list_box.find('div', {'class': 'list_summary'}) if not self.getConfig('keep_summary_html'): - summary = ''.join(summary_div(text=True)) + summary = ''.join(summary_div(string=True)) else: summary = self.utf8FromSoup(author_url, summary_div) diff --git a/fanficfare/adapters/adapter_ficbooknet.py b/fanficfare/adapters/adapter_ficbooknet.py index 6fcf0fc6..8b06a8f1 100644 --- a/fanficfare/adapters/adapter_ficbooknet.py +++ b/fanficfare/adapters/adapter_ficbooknet.py @@ -206,7 +206,7 @@ class FicBookNetAdapter(BaseSiteAdapter): else: self.story.setMetadata('status', 'In-Progress') - paircharsdt = soup.find('strong',text='Пэйринг и персонажи:') + paircharsdt = soup.find('strong',string='Пэйринг и персонажи:') # site keeps both ships and indiv chars in /pairings/ links. if paircharsdt: for paira in paircharsdt.find_next('div').find_all('a', href=re.compile(r'/pairings/')): diff --git a/fanficfare/adapters/adapter_fictionalleyarchiveorg.py b/fanficfare/adapters/adapter_fictionalleyarchiveorg.py index f8b04a10..5f754542 100644 --- a/fanficfare/adapters/adapter_fictionalleyarchiveorg.py +++ b/fanficfare/adapters/adapter_fictionalleyarchiveorg.py @@ -177,7 +177,7 @@ class FictionAlleyArchiveOrgSiteAdapter(BaseSiteAdapter): elif key == 'Words': self.story.setMetadata('numWords',val) - summary = soup.find('dt',text='Story Summary:') + summary = soup.find('dt',string='Story Summary:') if summary: summary = summary.find_next_sibling('dd') summary.name='div' @@ -210,7 +210,7 @@ class FictionAlleyArchiveOrgSiteAdapter(BaseSiteAdapter): if self.getConfig('include_author_notes'): row = chaptext.find_previous_sibling('div',class_='row') logger.debug(row) - andt = row.find('dt',text="Author's Note:") + andt = row.find('dt',string="Author's Note:") logger.debug(andt) if andt: chaptext.insert(0,andt.parent.extract()) diff --git a/fanficfare/adapters/adapter_fictionhuntcom.py b/fanficfare/adapters/adapter_fictionhuntcom.py index 5318df42..a78278af 100644 --- a/fanficfare/adapters/adapter_fictionhuntcom.py +++ b/fanficfare/adapters/adapter_fictionhuntcom.py @@ -235,7 +235,7 @@ class FictionHuntComSiteAdapter(BaseSiteAdapter): # logger.debug(data) self.story.setMetadata('title',stripHTML(soup.find('h1',{'class':'Story__title'}))) - summhead = soup.find('h5',text='Summary') + summhead = soup.find('h5',string='Summary') self.setDescription(url,summhead.find_next('div')) ## author: @@ -244,12 +244,12 @@ class FictionHuntComSiteAdapter(BaseSiteAdapter): self.story.setMetadata('authorUrl',autha['href']) self.story.setMetadata('author',autha.string) - updlab = soup.find('label',text='Last Updated:') + updlab = soup.find('label',string='Last Updated:') if updlab: update = updlab.find_next('time')['datetime'] self.story.setMetadata('dateUpdated', makeDate(update, self.dateformat)) - publab = soup.find('label',text='Published:') + publab = soup.find('label',string='Published:') if publab: pubdate = publab.find_next('time')['datetime'] self.story.setMetadata('datePublished', makeDate(pubdate, self.dateformat)) @@ -280,7 +280,7 @@ class FictionHuntComSiteAdapter(BaseSiteAdapter): # logger.debug(meta) # Find original ffnet URL - a = soup.find('a', text="Source") + a = soup.find('a', string="Source") self.story.setMetadata('origin',stripHTML(a)) self.story.setMetadata('originUrl',a['href']) diff --git a/fanficfare/adapters/adapter_fimfictionnet.py b/fanficfare/adapters/adapter_fimfictionnet.py index e93b03d9..6fc9cb76 100644 --- a/fanficfare/adapters/adapter_fimfictionnet.py +++ b/fanficfare/adapters/adapter_fimfictionnet.py @@ -304,7 +304,7 @@ class FimFictionNetSiteAdapter(BaseSiteAdapter): #sequels for header in soup.find_all('h1', {'class':'header-stories'}): - # I don't know why using text=re.compile with find() wouldn't work, but it didn't. + # I don't know why using string=re.compile with find() wouldn't work, but it didn't. if header.text.startswith('Sequels'): sequelContainer = header.parent for sequel in sequelContainer.find_all('a', {'class':'story_link'}): diff --git a/fanficfare/adapters/adapter_literotica.py b/fanficfare/adapters/adapter_literotica.py index db5539a6..fade1c9a 100644 --- a/fanficfare/adapters/adapter_literotica.py +++ b/fanficfare/adapters/adapter_literotica.py @@ -134,7 +134,7 @@ class LiteroticaSiteAdapter(BaseSiteAdapter): logger.debug("set opened url:%s"%self.url) soup1 = self.make_soup(data1) #strip comments from soup - [comment.extract() for comment in soup1.findAll(text=lambda text:isinstance(text, Comment))] + [comment.extract() for comment in soup1.findAll(string=lambda text:isinstance(text, Comment))] if "This submission is awaiting moderator's approval" in data1: raise exceptions.StoryDoesNotExist("This submission is awaiting moderator's approval. %s"%self.url) @@ -154,7 +154,7 @@ class LiteroticaSiteAdapter(BaseSiteAdapter): dataAuth = self.get_request(authorurl) soupAuth = self.make_soup(dataAuth) #strip comments from soup - [comment.extract() for comment in soupAuth.findAll(text=lambda text:isinstance(text, Comment))] + [comment.extract() for comment in soupAuth.findAll(string=lambda text:isinstance(text, Comment))] # logger.debug(soupAuth) ## Find link to url in author's page @@ -336,7 +336,7 @@ class LiteroticaSiteAdapter(BaseSiteAdapter): raw_page = raw_page.replace('

','

') # logger.debug("\tChapter text: %s" % raw_page) page_soup = self.make_soup(raw_page) - [comment.extract() for comment in page_soup.findAll(text=lambda text:isinstance(text, Comment))] + [comment.extract() for comment in page_soup.findAll(string=lambda text:isinstance(text, Comment))] story2 = page_soup.find('div', 'aa_ht').div # logger.debug('getPageText - story2: %s' % story2) diff --git a/fanficfare/adapters/adapter_masseffect2in.py b/fanficfare/adapters/adapter_masseffect2in.py index 5b9a5d83..4d6559a0 100644 --- a/fanficfare/adapters/adapter_masseffect2in.py +++ b/fanficfare/adapters/adapter_masseffect2in.py @@ -678,7 +678,7 @@ class Chapter(object): def _excludeEditorSignature(self, root): """Exclude editor signature from within `root' element.""" - for textNode in root.findAll(text=True): + for stringNode in root.findAll(string=True): if re.match(self.SIGNED_PATTERN, textNode.string): editorLink = textNode.findNext('a') if editorLink: diff --git a/fanficfare/adapters/adapter_mcstoriescom.py b/fanficfare/adapters/adapter_mcstoriescom.py index 705bfb91..60357572 100644 --- a/fanficfare/adapters/adapter_mcstoriescom.py +++ b/fanficfare/adapters/adapter_mcstoriescom.py @@ -83,7 +83,7 @@ class MCStoriesComSiteAdapter(BaseSiteAdapter): data1 = self.get_request(self.url) soup1 = self.make_soup(data1) #strip comments from soup - [comment.extract() for comment in soup1.find_all(text=lambda text:isinstance(text, Comment))] + [comment.extract() for comment in soup1.find_all(string=lambda text:isinstance(text, Comment))] if 'Page Not Found.' in data1: raise exceptions.StoryDoesNotExist(self.url) @@ -161,7 +161,7 @@ class MCStoriesComSiteAdapter(BaseSiteAdapter): soup1 = self.make_soup(data1) #strip comments from soup - [comment.extract() for comment in soup1.find_all(text=lambda text:isinstance(text, Comment))] + [comment.extract() for comment in soup1.find_all(string=lambda text:isinstance(text, Comment))] # get story text story1 = soup1.find('article', id='mcstories') diff --git a/fanficfare/adapters/adapter_novelfull.py b/fanficfare/adapters/adapter_novelfull.py index 1ff3d6a6..0e9d751a 100644 --- a/fanficfare/adapters/adapter_novelfull.py +++ b/fanficfare/adapters/adapter_novelfull.py @@ -40,7 +40,7 @@ class NovelFullSiteAdapter(BaseSiteAdapter): self.story.setMetadata("title", soup.select_one("h3.title").text) - for author in soup.find("h3", text="Author:").fetchNextSiblings( + for author in soup.find("h3", string="Author:").fetchNextSiblings( "a", href=re.compile("/author/") ): self.story.addToList("authorId", author.text) @@ -91,7 +91,7 @@ class NovelFullSiteAdapter(BaseSiteAdapter): content = soup.find(id="chapter-content") # Remove chapter header if present - chapter_header = content.find(["p", "h3"], text=re.compile(r"Chapter \d+:")) + chapter_header = content.find(["p", "h3"], string=re.compile(r"Chapter \d+:")) if chapter_header: chapter_header.decompose() diff --git a/fanficfare/adapters/adapter_novelonlinefullcom.py b/fanficfare/adapters/adapter_novelonlinefullcom.py index 040b2fe7..cf473d3c 100644 --- a/fanficfare/adapters/adapter_novelonlinefullcom.py +++ b/fanficfare/adapters/adapter_novelonlinefullcom.py @@ -189,7 +189,7 @@ class LightNovelGateSiteAdapter(BaseSiteAdapter): "Error downloading Chapter: %s! Missing required element!" % url) # Some comments we will get is invalid. Remove them all. - [comment.extract() for comment in story.find_all(text=lambda text:isinstance(text, Comment))] + [comment.extract() for comment in story.find_all(string=lambda text:isinstance(text, Comment))] # We don't need links. They have a bad css and they are not working most of times. [a.extract() for a in story.find_all('a')] diff --git a/fanficfare/adapters/adapter_readonlymindcom.py b/fanficfare/adapters/adapter_readonlymindcom.py index 6e007eab..26c42d1e 100644 --- a/fanficfare/adapters/adapter_readonlymindcom.py +++ b/fanficfare/adapters/adapter_readonlymindcom.py @@ -182,7 +182,7 @@ class ReadOnlyMindComAdapter(BaseSiteAdapter): soup = self.make_soup(self.get_request(url)) #strip comments from soup - # [comment.extract() for comment in soup1.find_all(text=lambda text:isinstance(text, Comment))] + # [comment.extract() for comment in soup1.find_all(string=lambda text:isinstance(text, Comment))] # story text story = soup.find('section', id='chapter-content') diff --git a/fanficfare/adapters/adapter_royalroadcom.py b/fanficfare/adapters/adapter_royalroadcom.py index 2512a7e5..f3d7929a 100644 --- a/fanficfare/adapters/adapter_royalroadcom.py +++ b/fanficfare/adapters/adapter_royalroadcom.py @@ -228,7 +228,7 @@ class RoyalRoadAdapter(BaseSiteAdapter): self.story.setMetadata('stars',stars) logger.debug("stars:(%s)"%self.story.getMetadata('stars')) - warning = soup.find('strong',text='Warning') + warning = soup.find('strong',string='Warning') if warning != None: for li in warning.find_next('ul').find_all('li'): self.story.addToList('warnings',stripHTML(li)) diff --git a/fanficfare/adapters/adapter_swiorgru.py b/fanficfare/adapters/adapter_swiorgru.py index fe08445f..013b0eaf 100644 --- a/fanficfare/adapters/adapter_swiorgru.py +++ b/fanficfare/adapters/adapter_swiorgru.py @@ -67,7 +67,7 @@ class SwiOrgRuAdapter(BaseSiteAdapter): self.story.setMetadata('title', stripHTML(title.text)) logger.debug("Title: (%s)"%self.story.getMetadata('title')) - author_title = soup.find('strong', text = re.compile(u"Автор: ")) + author_title = soup.find('strong', string = re.compile(u"Автор: ")) if author_title == None: raise exceptions.FailedToDownload("Error downloading page: %s! Missing required author_title element!" % url) @@ -78,11 +78,11 @@ class SwiOrgRuAdapter(BaseSiteAdapter): self.story.setMetadata('author', author.text) logger.debug("Author: (%s)"%self.story.getMetadata('author')) - date_pub = soup.find('em', text = re.compile(r'\d{4}.\d{2}.\d{2}')) + date_pub = soup.find('em', string = re.compile(r'\d{4}.\d{2}.\d{2}')) if not date_pub == None: self.story.setMetadata('datePublished', makeDate(date_pub.text, self.dateformat)) - rating_label = soup.find('strong', text = re.compile(u"рейтинг:")) + rating_label = soup.find('strong', string = re.compile(u"рейтинг:")) if not rating_label == None: rating = rating_label.next_sibling.next_sibling self.story.setMetadata('rating', stripHTML(rating)) @@ -98,12 +98,12 @@ class SwiOrgRuAdapter(BaseSiteAdapter): character=characters[x] self.story.addToList('characters', character['title']) - if soup.find('font', color = r"green", text = u"завершен"): + if soup.find('font', color = r"green", string = u"завершен"): self.story.setMetadata('status', 'Completed') else: self.story.setMetadata('status', 'In-Progress') - categories_label = soup.find('strong', text = u"категории:") + categories_label = soup.find('strong', string = u"категории:") if not categories_label == None: categories_element = categories_label.next_sibling.next_sibling categories = re.findall(r'"(.+?)"', categories_element.text) @@ -111,7 +111,7 @@ class SwiOrgRuAdapter(BaseSiteAdapter): category=categories[x] self.story.addToList('category', category) - chapters_header = soup.find('h2', text = re.compile(u"Главы:")) + chapters_header = soup.find('h2', string = re.compile(u"Главы:")) if chapters_header==None: raise exceptions.FailedToDownload("Error downloading page: %s! Missing required chapters_header element!" % url) diff --git a/fanficfare/adapters/adapter_voracity2eficcom.py b/fanficfare/adapters/adapter_voracity2eficcom.py index 93d54352..e90017a3 100644 --- a/fanficfare/adapters/adapter_voracity2eficcom.py +++ b/fanficfare/adapters/adapter_voracity2eficcom.py @@ -104,7 +104,7 @@ class Voracity2EficComAdapter(BaseSiteAdapter): # error. errortext_div = soup.find('div', {'class': 'errortext'}) if errortext_div: - error_text = ''.join(errortext_div(text=True)).strip() + error_text = ''.join(errortext_div(string=True)).strip() if error_text == 'Registered Users Only': if not (self.is_adult or self.getConfig('is_adult')): raise exceptions.AdultCheckRequired(self.url) @@ -167,7 +167,7 @@ class Voracity2EficComAdapter(BaseSiteAdapter): if keep_summary_html: contents.append(self.utf8FromSoup(self.url, sibling)) else: - contents.append(''.join(sibling(text=True))) + contents.append(''.join(sibling(string=True))) else: contents.append(sibling) diff --git a/fanficfare/adapters/adapter_wuxiaworldxyz.py b/fanficfare/adapters/adapter_wuxiaworldxyz.py index 2da63388..4d1fee46 100644 --- a/fanficfare/adapters/adapter_wuxiaworldxyz.py +++ b/fanficfare/adapters/adapter_wuxiaworldxyz.py @@ -85,7 +85,7 @@ class WuxiaWorldXyzSiteAdapter(BaseSiteAdapter): ## site doesn't have authorUrl links. ## getting status - status_label = soup.find('h3',text='Status:') + status_label = soup.find('h3',string='Status:') status = stripHTML(status_label.nextSibling) if status == 'Completed': self.story.setMetadata('status', 'Completed') diff --git a/fanficfare/adapters/adapter_wwwaneroticstorycom.py b/fanficfare/adapters/adapter_wwwaneroticstorycom.py index 3a2cbc0f..b89fa7bc 100644 --- a/fanficfare/adapters/adapter_wwwaneroticstorycom.py +++ b/fanficfare/adapters/adapter_wwwaneroticstorycom.py @@ -87,7 +87,7 @@ class WWWAnEroticStoryComAdapter(BaseSiteAdapter): data1 = self.get_request(self.url) soup1 = self.make_soup(data1) #strip comments and scripts from soup - [comment.extract() for comment in soup1.find_all(text=lambda text:isinstance(text, Comment))] + [comment.extract() for comment in soup1.find_all(string=lambda text:isinstance(text, Comment))] [script.extract() for script in soup1.find_all('script')] url = self.url diff --git a/fanficfare/adapters/adapter_wwwnovelallcom.py b/fanficfare/adapters/adapter_wwwnovelallcom.py index c10a5771..3625f26d 100644 --- a/fanficfare/adapters/adapter_wwwnovelallcom.py +++ b/fanficfare/adapters/adapter_wwwnovelallcom.py @@ -142,7 +142,7 @@ class WWWNovelAllComAdapter(BaseSiteAdapter): title = title[:-len(" Novel")] self.story.setMetadata('title', title) - authorspan = soup.find('span',text='Author:') + authorspan = soup.find('span',string='Author:') authora = authorspan.find_next_sibling('a') ## authors appear to just be comma separated and the only URL ## is a search, so this appears to work. @@ -259,7 +259,7 @@ class WWWNovelAllComAdapter(BaseSiteAdapter): "Error downloading Chapter: %s! Missing required element!" % url) # Some comments we will get is invalid. Remove them all. - for comment in story.find_all(text=lambda text:isinstance(text, Comment)): + for comment in story.find_all(string=lambda text:isinstance(text, Comment)): comment.extract() extract_tags = ('a', 'ins', 'script') diff --git a/fanficfare/adapters/adapter_wwwutopiastoriescom.py b/fanficfare/adapters/adapter_wwwutopiastoriescom.py index 12608a90..8bc514ca 100644 --- a/fanficfare/adapters/adapter_wwwutopiastoriescom.py +++ b/fanficfare/adapters/adapter_wwwutopiastoriescom.py @@ -203,6 +203,6 @@ class WWWUtopiastoriesComAdapter(BaseSiteAdapter): tag.extract() #strip comments from story - [comment.extract() for comment in story.findAll(text=lambda text:isinstance(text, Comment))] + [comment.extract() for comment in story.findAll(string=lambda text:isinstance(text, Comment))] return self.utf8FromSoup(url,story) diff --git a/fanficfare/adapters/base_otw_adapter.py b/fanficfare/adapters/base_otw_adapter.py index 4d2f2f83..1409a13b 100644 --- a/fanficfare/adapters/base_otw_adapter.py +++ b/fanficfare/adapters/base_otw_adapter.py @@ -160,7 +160,7 @@ class BaseOTWAdapter(BaseSiteAdapter): ## "?view_adult=true" doesn't work on base story ## URL anymore, which means we have to metasoup = self.make_soup(meta) - a = metasoup.find('a',text='Proceed') + a = metasoup.find('a',string='Proceed') metaurl = 'https://'+self.host+a['href'] meta = self.get_request(metaurl) else: diff --git a/fanficfare/adapters/base_xenforo2forum_adapter.py b/fanficfare/adapters/base_xenforo2forum_adapter.py index 919394b4..b1e06a15 100644 --- a/fanficfare/adapters/base_xenforo2forum_adapter.py +++ b/fanficfare/adapters/base_xenforo2forum_adapter.py @@ -112,7 +112,7 @@ class BaseXenForo2ForumAdapter(BaseXenForoForumAdapter): if title: title.a.decompose() # remove RSS link. self.story.setMetadata("threadmarks_title",stripHTML(title)) - statusdt = header.find('dt',text="Index progress") + statusdt = header.find('dt',string="Index progress") if statusdt: statusdd = statusdt.find_next_sibling('dd') if statusdd: