HTML1 [#golang] html 태그 제거(strip tags) golang으로 html 페이지를 크롤링하다보면 가끔 태그를 제거하고 텍스트만 받고 싶은 경우가 있다. 이럴때는 package main import ( "fmt" "github.com/grokify/html-strip-tags-go" ) func main() { text := "Hello World!this is in div element." stripped := strip.StripTags(text) fmt.Println(text) fmt.Println(stripped) } 를 사용하면 간단하게 해결할 수 있다. 2020. 3. 30. 이전 1 다음