Skip to content

Commit

Permalink
Merge pull request #2013 from zerty/hotfix
Browse files Browse the repository at this point in the history
HOTFIX for scribblehub browser search blocking search progess
  • Loading branch information
dipu-bd committed Jul 26, 2023
2 parents 2a597c7 + 851d7bf commit d8f2fa5
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions sources/en/s/scribblehub.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@

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
#from urllib.parse import urljoin, quote_plus
from urllib.parse import urljoin

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -52,16 +53,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 d8f2fa5

Please sign in to comment.