Skip to content

Commit

Permalink
HOTFIX for scribblehub browser search blocking search progess
Browse files Browse the repository at this point in the history
  • Loading branch information
zerty committed Jul 22, 2023
1 parent 2a597c7 commit dccc526
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions sources/en/s/scribblehub.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

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

from urllib.parse import urljoin, quote_plus

Expand Down Expand Up @@ -52,16 +52,17 @@ def initialize(self) -> None:
)

def select_search_items_in_browser(self, query: str) -> Generator[Tag, None, None]:
self.visit(
urljoin(
self.home_url, "/?s={}&post_type=fictionposts".format(quote_plus(query))
)
)
self.browser.wait(".search")
for elem in self.browser.soup.select(
".fic .search_main_box .search_body .search_title a"
):
yield elem
# self.visit(
# urljoin(
# self.home_url, "/?s={}&post_type=fictionposts".format(quote_plus(query))
# )
# )
# self.browser.wait(".search")
# for elem in self.browser.soup.select(
# ".fic .search_main_box .search_body .search_title a"
# ):
# yield elem
raise LNException('Browser Search not supported')

def select_search_items(self, query: str) -> Generator[Tag, None, None]:
raise FallbackToBrowser()
Expand Down

0 comments on commit dccc526

Please sign in to comment.