Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'style' #141

Open
kmlbgn opened this issue Sep 18, 2023 · 2 comments
Open

KeyError: 'style' #141

kmlbgn opened this issue Sep 18, 2023 · 2 comments

Comments

@kmlbgn
Copy link

kmlbgn commented Sep 18, 2023

New error just dropped from nowhere (was working in the past).
Don't know why, don't know how.
The page being parsed is simple, has a medium sized table (50ish entries 6 columns).

image
@kmlbgn
Copy link
Author

kmlbgn commented Sep 18, 2023

After a bit of troubleshooting, I have reasons to think it comes from database/table view processing. Did Notion change the structure of those table and got rid of span?

def process_table_views(self, soup):
# if there are any table views in the page, add links to the title rows
# the link to the row item is equal to its data-block-id without dashes
for table_view in soup.findAll("div", {"class": "notion-table-view"}):
for table_row in table_view.findAll(
"div", {"class": "notion-collection-item"}
):
table_row_block_id = table_row["data-block-id"]
table_row_href = "/" + table_row_block_id.replace("-", "")
row_target_span = table_row.find("span")
row_target_span["style"] = row_target_span["style"].replace(
"pointer-events: none;", ""
)
row_link_wrapper = soup.new_tag(
"a",
attrs={
"href": table_row_href,
"style": "cursor: pointer; color: inherit; text-decoration: none; fill: inherit;",
},
)
row_target_span.wrap(row_link_wrapper)

@kmlbgn kmlbgn changed the title KeyError: style KeyError: 'style' Sep 22, 2023
@phith0n
Copy link

phith0n commented Nov 24, 2023

Same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants