antchfx / htmlquery

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

Add configurable timeout to LoadURL #36

Closed cnp96 closed 3 years ago

cnp96 commented 3 years ago

The LoadURL method should have a timeout parameter to avoid indefinite load time. Optionally, it could also accept any other client parameters.


func LoadURL(url string, clientOpts ...*http.Client) (*html.Node, error) {

}
zhengchun commented 3 years ago

Hello, @cnp96 , Thanks for your feedback.

No any plan to change or add more feature for LoadURL method. You can implements your http client to load html document and then call Parse(reader).