Trouble parsing HTML and getting tags

Hi! I’m doing some web scraping work and for some reason the request Body I’ve got from the page has some strange structure which I’m not familiar with. Could someone have a look and tell me what is it so I can search how to parse that properly? I how be really glad!

My code for scraping:



    //Url to login
url := ""

bow := surf.NewBrowser()
fmt.Println("create new browser")
fmt.Println("New user-Agent")
err := bow.Open(url)
if err != nil {
fmt.Println("Login page oppened")
fm, _ := bow.Form("form.ajax-form")
fm.Input("session_key", "my_login")
fm.Input("session_password", "my_pass")
if fm.Submit() != nil {
    //open special link after login to get to feed
err = bow.Open("")
if err != nil {
body := bow.Body()
ioutil.WriteFile("html", []byte(body), 0666)


Some html I got from the page:

< code style=“display: none” id=“bpr-guid-266082” >

This HTML snippet contains a code element. This element can contain anything. There is no way to parse it as HTML. It looks like JavaScript.

Could you try with curl using this:
curl -u username:password

Then you can compare this response with what you got from go.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.