Adjusted css rules for custom fonts

This commit is contained in:
Leonardo Cavaletti 2020-05-25 19:32:09 +01:00
parent 75c3da2210
commit fd7dcfbd1b
2 changed files with 5 additions and 5 deletions

View File

@ -22,6 +22,7 @@ class notion_page_loaded(object):
log.debug( log.debug(
f"Waiting for page content to load" f"Waiting for page content to load"
f" (pending blocks: {unknown_blocks}," f" (pending blocks: {unknown_blocks},"
f" loading spinners: {loading_spinners},"
f" loaded scrollers: {len(scrollers_with_children)} / {len(scrollers)})" f" loaded scrollers: {len(scrollers_with_children)} / {len(scrollers)})"
) )
all_scrollers_loaded = len(scrollers) == len(scrollers_with_children) all_scrollers_loaded = len(scrollers) == len(scrollers_with_children)

View File

@ -234,7 +234,7 @@ class Parser:
self.driver.get(url) self.driver.get(url)
try: try:
WebDriverWait(self.driver, 10).until(notion_page_loaded()) WebDriverWait(self.driver, 60).until(notion_page_loaded())
except TimeoutException as ex: except TimeoutException as ex:
log.critical( log.critical(
"Timeout waiting for page content to load, or no content found." "Timeout waiting for page content to load, or no content found."
@ -446,12 +446,11 @@ class Parser:
fonts_selectors = { fonts_selectors = {
"site": "div:not(.notion-code-block)", "site": "div:not(.notion-code-block)",
"navbar": ".notion-topbar div", "navbar": ".notion-topbar div",
"title": ".notion-page-block > div, .notion-collection_view_page-block > div", "title": ".notion-page-block > div, .notion-collection_view_page-block > div[data-root]",
"h1": ".notion-header-block div, notion-page-content >" "h1": ".notion-header-block div, notion-page-content > notion-collection_view-block > div:first-child div",
" notion-collection_view-block > div:first-child div",
"h2": ".notion-sub_header-block div", "h2": ".notion-sub_header-block div",
"h3": ".notion-sub_sub_header-block div", "h3": ".notion-sub_sub_header-block div",
"body": ".notion-app-inner", "body": ".notion-scroller",
"code": ".notion-code-block *", "code": ".notion-code-block *",
} }
custom_fonts = self.get_page_config(url).get("fonts", {}) custom_fonts = self.get_page_config(url).get("fonts", {})