antchfx / xmlquery

xmlquery is Golang XPath package for XML query.
https://github.com/antchfx/xpath
MIT License
444 stars 89 forks source link

Cookie support #47

Closed crashbrz closed 3 years ago

crashbrz commented 3 years ago

Hi! Any chance to add a cookies support for the function xmlquery.LoadURL? I'm not a Go expert, that why I did not make a pull request, but I think a good option is to use
doc.Header.Add("Cookie",cookies)

and to call the function: doc, err := xmlquery.LoadURL("http://www.example.com/sitemap.xml","cookiename=value; cookiename1=value;")

zhengchun commented 3 years ago

Sorry, no any plan to support this feature.

you can visit this post to learn how to write your HTTP client . https://stackoverflow.com/questions/12130582/setting-cookies-with-net-http