Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Build Web Scraper -> Step-3 -> Making the HTTP Request

package main

import (
"fmt"
_ "io/ioutil"
"net/http"
_ "strings"
)

func main() {
// Make HTTP request
resp, err := http.Get("hts://weather.com/weather/today/")
// Error handling
if err!= nil {
fmt.Println("Error sending request:", err)
return
}
defer resp.Body.Close()

// Print status code
fmt.Println("Status code:", resp.StatusCode)
}

//Can't able to get the output correctly is there anything wrong in my code

*Error sending request: Get h
://weather.com/weather/today/: dial tcp: lookup weather.com on 172.31.0.2:53: write udp 172.17.0.9:36978->172.31.0.2:53: write: operation not permitted
*

//getting this error in my console
by

1 Answer

iamabhishek
Hi, we are facing some issues with Internet access in the compiler environment and hence this issue. We are working on fixing this.

Login / Signup to Answer the Question.