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

sql - can we replace full join with union of left and right join? why not? -

javascript - Parallax scrolling and fixed footer code causing width issues -

iOS: Performance of reloading UIImage(name:...) -