Skip to content

Commit f90c1e2

Browse files
muodovsammacbeth
andauthored
scrape buttons that are input elements (#171)
Co-authored-by: Sam Macbeth <[email protected]>
1 parent 5968402 commit f90c1e2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

collectors/CookiePopups/scrapeScript.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,12 @@ function getUniqueSelector(el) {
304304
*/
305305
function getButtonData(el) {
306306
const actionableButtons = excludeContainers(getButtonLikeElements(el)).filter(
307-
(b) => isVisible(b) && !isDisabled(b) && b.innerText.trim(),
307+
(b) =>
308+
isVisible(b) &&
309+
!isDisabled(b) &&
310+
(b.innerText.trim() ||
311+
// <input> values do not appear in innerText
312+
(b instanceof HTMLInputElement && b.type in ['submit', 'button'] && b.value?.trim())),
308313
);
309314

310315
return actionableButtons.map((b) => ({

0 commit comments

Comments
 (0)