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

Support startsWith selector #35

Open
nikitavoloboev opened this issue Nov 20, 2023 · 1 comment
Open

Support startsWith selector #35

nikitavoloboev opened this issue Nov 20, 2023 · 1 comment

Comments

@nikitavoloboev
Copy link

Want to index edgedb docs https://www.edgedb.com/docs/datamodel/index

Docs exist inside this class layout_docsContent__JzhPH where JzhPH changes page to page.

Currently the selector wants fixed value. Would be nice to support [class^="layout_docsContent__JzhPH"] essentially.

@nikitavoloboev
Copy link
Author

nikitavoloboev commented Nov 20, 2023

I tried changing getPageHtml to

export function getPageHtml(page: Page) {
  return page.evaluate((classNameStart) => {
    const el = document.querySelector(
      `[class^='${classNameStart}']`
    ) as HTMLElement | null;
    return el?.innerText || "";
  }, config.selector);
}

then in config passing:

selector: `layout_docsContent`,

but that failed :(

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

1 participant