antchfx / htmlquery

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

Can,t Get Scripts useing xpath expression #67

Closed Crypt00o closed 10 months ago

Crypt00o commented 10 months ago

i can,t parse scripts from document , using xpath query for example :

document:

<html>
           <head>
                <script src="https//example.com/example1.js"></script>
            </head>
            <body>
                 <script src="https//example.com/example2.js"></script>
             </body>
</html>

nodes,_:=html.QueryAll(doc,"//script[@src]")
fmt.Println(nodes)   // will ouput [] empty *html.Node slice