Home >Backend Development >Golang >How Can I Access the Deprecated Go `exp/html` Library?
Retrieving exp/html for Go1
After the release of Go1, the exp/ codebase was removed. This left developers wondering how to regain access to libraries such as exp/html.
One potential solution involves cloning the Go repository from Google and creating a symbolic link in your GOPATH to the pkg/exp directory within the repository. However, this method is not suggested due to the incomplete nature of the exp/html library.
An alternative approach is to use go get to install the library directly:
go get code.google.com/p/go/src/pkg/exp/html
While this initially appeared to work, recent attempts have proven unsuccessful. As a result, the recommended method for retrieving exp/html is to check out the Go source code and install the library from source. This is a relatively straightforward process and provides access to the desired functionality.
Additional Options
If the exp/html library does not fully meet your needs, consider exploring Go-HTML-Transform. This package provides a more complete HTML parser, along with CSS selector-based scraping and transformation capabilities.
The above is the detailed content of How Can I Access the Deprecated Go `exp/html` Library?. For more information, please follow other related articles on the PHP Chinese website!