selecting collections doesn't work in a way specified in docs
See original GitHub issueSubject of the issue
Retrieving collections doesn’t work as described in docs
Your environment
- version of node: 8.5
- version of npm: yarn 1.0.2
reproduction here: https://runkit.com/marzelin/x-ray-bug
given this example:
const x = require("x-ray")()
const html = `
<body>
<ul>
<li>1-1</li>
<li>1-2</li>
<li>1-3</li>
</ul>
<ul>
<li>2-1</li>
<li>2-2</li>
<li>2-3</li>
</ul>
<ul>
<li>3-1</li>
<li>3-2</li>
<li>3-3</li>
</ul>
</body>`
x(html, "body", x("ul", ["li"]))((err, result) => {
console.log(result)
})
per docs x('ul', ['li'])
should select all items in the first list but it selects all items in all lists.
Also, per docs x(['ul'], ['li'])
should return all items in all lists, but it returns nothing.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
Managing collections and documents - Pinpoint Help
Open the Documents view in your collection (Documents in the navigation pane); Check the box next to specific documents that you want to...
Read more >Sharing in Google Docs
Sharing in Google Docs is a great way to work on collaborative documents with anyone you choose. There are a few tricks you...
Read more >Cloud Firestore Data model - Firebase
Collections and documents are created implicitly in Cloud Firestore. Simply assign data to a document within a collection. If either the collection or...
Read more >Create collections - Configuration Manager - Microsoft Learn
In the Select Collections dialog box, select the collections you want to exclude from the new collection, and then select OK. Preview collection...
Read more >Databases and Collections — MongoDB Manual
By default, a collection does not require its documents to have the same schema; i.e. the documents in a single collection do not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@JinnaBalu The selector:
x('ul', ['li'])
should only return items from the first list (["1-1", "1-2", "1-3"]
). The result you’ve got is all items from all lists. The selector that should return all items from all lists isx(['ul'], ['li'])
.I ran into this issue too 😬