Skip to content

Commit

Permalink
Merge pull request #2050 from zerty/ranobes2
Browse files Browse the repository at this point in the history
Fix ranobes, switch to browser on bot detection
  • Loading branch information
dipu-bd authored Aug 20, 2023
2 parents 5fdd0e8 + cbb6874 commit f65849b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sources/en/r/ranobes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from lncrawl.models import Chapter, SearchResult, Volume
from lncrawl.templates.browser.searchable import SearchableBrowserTemplate
from lncrawl.core.exeptions import FallbackToBrowser

from urllib.parse import urljoin, quote_plus

Expand Down Expand Up @@ -146,4 +147,7 @@ def visit_chapter_page_in_browser(self, chapter: Chapter) -> None:
self.browser.wait(".structure")

def select_chapter_body(self, soup: BeautifulSoup) -> Tag:
return soup.select_one("div#arrticle")
if soup.select_one("div#arrticle"):
return soup.select_one("div#arrticle")
else:
raise FallbackToBrowser

0 comments on commit f65849b

Please sign in to comment.