Closed gummipunkt closed 7 months ago
Use :is()
then put a comma separated list of selectors inside.
Example:
export const config: Config = {
url: "https://example.com",
match: "https://example.com/**",
selector: `:is(.selector1, .selector2, #complex > .selctor > #3, .etc)`,
maxPagesToCrawl: 50,
outputFileName: "output.json",
};
Thanks, but it doesn't work:
selector: "is: (.tab-content, .article, .manu-content, #handle-tab-lightning)",
(replaced only here ' with ")
No space after the is, it’s :is(…)
not :is (…)
Thanks, solved this problem, but the next one is right around the corner:
WARN PlaywrightCrawler: Reclaiming failed request back to the list or queue. page.waitForSelector: Unexpected token "(" while parsing selector "is:(.tab-content, .article, .manu-content, #handle-tab-lightning)"
@gummipunkt It’s not is:(…)
, it’s :is(…)
@gummipunkt It’s not
is:(…)
, it’s:is(…)
I'm just an idiot. Thanks a lot.
Hi,
I am trying to use the :is as stated above - The code runs, but I only get the first selector:
selector: :is(.tc_richcontent, .tc_page__body__standfirst)
only gives me .tc_richcontent in the output. Any suggestions to fix this?
Is it possible to use multiple selectors?