以下のように、body > div.default-container > main > div.l-content > section > div > section:nth-child("*")
で'body > div.default-container > main > div.l-content > section > div > section:nth-child(2)'
,'body > div.default-container > main > div.l-content > section > div > section:nth-child(1)'
を含んだ要素を全て取得できると思っていたのですが、どうもできません。
どこが間違っていますでしょうか?
document.querySelectorAll('body > div.default-container > main > div.l-content > section > div > section:nth-child(2)') NodeList [section.items-box] document.querySelectorAll('body > div.default-container > main > div.l-content > section > div > section:nth-child(1)') NodeList [section.items-box] document.querySelectorAll('body > div.default-container > main > div.l-content > section > div > section:nth-child("*")') VM84784:1 Uncaught DOMException: Failed to execute 'querySelectorAll' on 'Document': 'body > div.default-container > main > div.l-content > section > div > section:nth-child("*")' is not a valid selector. at <anonymous>:1:10
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。