-
Scenario: you want to count the number of elements on a page, a div.card or table.tr. JavaScipt has a count method: https://www.geeksforgeeks.org/collect-js-count-function/ I can't seem to get it working in Flyscrape. How would you do it? |
Beta Was this translation helpful? Give feedback.
Answered by
philippta
Feb 19, 2024
Replies: 1 comment
-
The way you count elements in JavaScript / Flyscrape is: const numberOfCards = doc.find(".card").length;
const numberOfTableRows = doc.find("table tr").length; |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
dynabler
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The way you count elements in JavaScript / Flyscrape is: