go - Golang web scraper NTLM authentication -


a golang web scraper needs extract information webpage ntlm-authenticated.

having valid username & password, how can web scraper perform ntlm 4-way handshake server in order gain access protected webpage behind?

url, username, password := "http://www.some-website.com", "admin", "12345"  client := &http.client{} req, _ := http.newrequest("get", url, nil) req.header.set("authorization", "ntlm") res, _ := client.do(req) 

you can use package azure/go-ntlmssp authenticate before start scraping.

url, username, password := "http://www.some-website.com", "admin", "12345"  client := &http.client{     transport: ntlmssp.negotiator{         roundtripper:&http.transport{},     }, }  req, _ := http.newrequest("get", url, nil) req.setbasicauth(username, password)  res, _ := client.do(req) 

Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

Laravel mail error `Swift_TransportException in StreamBuffer.php line 269: Connection could not be established with host smtp.gmail.com [ #0]` -

C#.NET Oracle.ManagedDataAccess ConfigSchema.xsd -