question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Convert to [attribute] without value

See original GitHub issue

Very cool project! 💯

Is it possible to further simplify the selectors if the attribute values are different? For example the output below:

[href='https\3A \/\/www\.w3schools\.com\/css\/css_attribute_selectors\.asp'] h3
[href='https\3A \/\/developer\.mozilla\.org\/en-US\/docs\/Web\/CSS\/Attribute_selectors'] h3
[href='https\3A \/\/css-tricks\.com\/almanac\/selectors\/a\/attribute\/'] h3

Can be simplified even more like this:

[href] h3

You can replicate this as these are just title links from Google Search page.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
fczbkkcommented, Aug 24, 2021

@roniemartinez I have checked the SelectorGadget. It is a UI tool for iterative building of a selector that matches multiple elements. I think you are looking for a functionality that is out of scope for this library. Something like that could probably be built on top of this library. But it was from the beginning created to produce selectors that are not fuzzy.

0reactions
roniemartinezcommented, Aug 24, 2021

@fczbkk Thanks for looking into this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set attribute without value - javascript - Stack Overflow
You should use JQuery prop() method to create name-only attributes. $(body).prop('data-body', true).
Read more >
How to set attribute without value using jQuery - GeeksforGeeks
There are many ways to set attributes without value using jQuery. jQuery prop() method is used to get or set the values of...
Read more >
parse error [Error: Attribute without value · Issue #281 - GitHub
I have some XML which has some odd data in it, is there a way to ignore this? ... the last attribute is...
Read more >
HTML value Attribute - W3Schools
For <li> elements, the value attribute sets the value of the list item (for ordered lists). The next list items will increment from...
Read more >
attr() - CSS: Cascading Style Sheets - MDN Web Docs
The attr() CSS function is used to retrieve the value of an attribute of the selected element and use it in the stylesheet....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found