i want get the price 2930.15 (follow red frame)
c.OnHTML("div[id=price]", func(e *colly.HTMLElement) {
fmt.Printf("test----%+v
",e)
price,err := strconv.ParseFloat(e.Text,64)
//price := e.Text
fmt.Printf("********* price----%+v
",price)
if err != nil {
fmt.Printf("parse err---%+v
",err)
}
})
then print
test----&{Name:div Text:@now@ attributes:[{Namespace: Key:id Val:price} {Namespace: Key:class Val:@UD_change@}] Request:0xc00013c280 Response:0xc000354240 DOM:0xc000558180 Index:0}
********* price----0
parse err---strconv.ParseFloat: parsing "@now@": invalid syntax
how to do ? where i wrong?