doc,err:=goquery.NewDocument("https://translate.google.co.jp/?hl=ja#en/ja/apple")
if err!=nil{
fmt.Print ("url scarapping failed")
}
fmt.Println(doc.Find("span#result_box").Text())
}
I'd like to get Google translation results on jquery, but the translation results are displayed
<span id="result_box">(shown here)</span>
There is a blank space in .
It was done when I implemented it in python, but I can't do it in go. Why?
When I tried opening https://translate.google.co.jp/?hl=ja#en/ja/apple, I found this DOM structure.
<span id="result_box" class="short_text" lang="ja">span class="">Apple</span>>
If you take blank characters from the sample code, I think you can get them.
doc.Find("span#result_box").Text()
© 2024 OneMinuteCode. All rights reserved.