antchfx / htmlquery

htmlquery is golang XPath package for HTML query.
https://github.com/antchfx/xpath
MIT License
723 stars 73 forks source link

Add method with combined SelectAttr and ExistsAttr functionality #46

Closed moredure closed 1 year ago

moredure commented 3 years ago

Attr method should allow to use returned value in case attr exists (even for attributes without value) or discard value in case it's missing.

mathieu-aubin commented 2 years ago

Can you elaborate on what this does? Is it getting used at all within the project? Sorry i had to ask. Comments add relevant info that allows people like me, which dont have involvement or barely any into a project understand and maybe, just maybe, give a f*** about what others do in general.

zhengchun commented 1 year ago

Sorry, I read all the questions or PR, but some of question were not answered in time and then forgot for a long time.

I had merged PR #44 that add new mthod ExistsAttr(), new method Attr) (val string, exists bool) is not necessary, use SelectAttr() if you want to get the attribute value, or use ExistsAttr() if just check the specified node whether exists the attribute.

moredure commented 1 year ago

@zhengchun, thank you!