func (s *Scraper) SetHeaders(site string, newHeaders map[string]string) {
	s.Headers[site] = newHeaders

	for k, v := range newHeaders {
		s.Headers[site][k] = v
	}

	s.Collector.OnRequest(func(r *colly.Request) {
		headers := s.Headers["global"]
		for k, v := range s.Headers[r.URL.Hostname()] {
			headers[k] = v
		}

		for k, v := range headers {
			if len(k) > 0 && len(v) > 0 {
				r.Headers.Set(k, v)
			}
		}
	})
}
// Sets headers for subsequent requests on a specific site - set site to "pcpartpicker.com" for PCPP or "global" for all sites.
Sets headers for subsequent requests on a specific site - set site to "pcpartpicker.com" for PCPP or "global" for all sites.
// Sets headers for subsequent requests on a specific site - set site to " pcpartpicker . com " for PCPP or " global " for all sites .
func (s *Scraper) SetHeaders(site string, newHeaders map[string]string) {
	s.Headers[site] = newHeaders
	for k, v := range newHeaders {
		s.Headers[site][k] = v
	}
	s.Collector.OnRequest(func(r *colly.Request) {
		headers := s.Headers["global"]
		for k, v := range s.Headers[r.URL.Hostname()] {
			headers[k] = v
		}
		for k, v := range headers {
			if len(k) > 0 && len(v) > 0 {
				r.Headers.Set(k, v)
			}
		}
	})
}
func ( s * Scraper ) SetHeaders ( site string , newHeaders map [ string ] string ) { s . Headers [ site ] = newHeaders for k , v := range newHeaders { s . Headers [ site ] [ k ] = v } s . Collector . OnRequest ( func ( r * colly . Request ) { headers := s . Headers [ " " ] for k , v := range s . Headers [ r . URL . Hostname ( ) ] { headers [ k ] = v } for k , v := range headers { if len ( k ) > 0 && len ( v ) > 0 { r . Headers . Set ( k , v ) } } } ) }
Sets headers for subsequent requests on a specific site - set site to "pcpartpicker.com" for PCPP or "global" for all sites.
Sets headers for subsequent requests on a specific site - set site to " pcpartpicker . com " for PCPP or " global " for all sites .