autarc / optimal-select

Get efficient & robust CSS selectors for HTML elements

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

getMultiSelector failure on a tag

entrptaher opened this issue · comments

getMultiSelector fails for the simplest tag on hackernews.
image

OptimalSelect.getSingleSelector(document.querySelector('.storylink'))
"[id="19997188"] .storylink"

OptimalSelect.getMultiSelector([document.querySelector('.storylink')])
optimize.js:135 Uncaught DOMException: Failed to execute 'querySelectorAll' on 'Document': '[id] a.reddit.com/r/gamedev/comments/bs6n3l/apple_removed_my_game_from_the_app_store_because/"]' is not a valid selector.
    at optimizePart (<anonymous>:469:30)
    at optimize (<anonymous>:375:27)
    at Object.getMultiSelector (<anonymous>:1050:41)
    at <anonymous>:1:15