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

ENH: Improve table to dict parser to accept custom XPath for table cell. #65

Merged
merged 1 commit into from Sep 2, 2022

Conversation

hhslepicka
Copy link
Contributor

Allow users to specify a custom XPath for the table cell elements for situations in which th is mixed with td on rows.

Here is a real use case from the Nasdaq Screener table:

screener_table = self.find_element(selector="nasdaq-screener__table", by=By.CLASS_NAME)
# Data from the table using a custom cell selector
data = table_to_dict(
    table=screener_table,
    has_header=True,
    cell_xpath="//*[contains(@class,'nasdaq-screener__cell')]"
)

@hhslepicka hhslepicka merged commit 90cad69 into botcity-dev:main Sep 2, 2022
@hhslepicka hhslepicka deleted the improve-parser branch September 2, 2022 16:36
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

Successfully merging this pull request may close these issues.

None yet

2 participants