Documentation
¶
Index ¶
- Constants
- Variables
- func ExtractCharset(htmlContent []byte) stringdeprecated
- func ExtractContentTypeCharset(contentType string) (charset string)deprecated
- func InsertInto(s string, interval int, sep rune) stringdeprecated
- func ResponseDecoding(body []byte, label string) stringdeprecated
- type Banner
- type Fetcher
- type Options
Constants ¶
View Source
const ( DefaultMaxBodySize int64 = 5 * 1024 * 1024 DefaultMaxIconSize int64 = 512 * 1024 )
View Source
const JSExecuteTemplate = `` /* 813-byte string literal not displayed */
Variables ¶
View Source
var DefaultStackDepthLimit = 300
默认JavaScript执行的堆栈深度限制
Functions ¶
func ExtractCharset
deprecated
func ExtractContentTypeCharset
deprecated
func InsertInto
deprecated
func ResponseDecoding
deprecated
Types ¶
type Banner ¶
type Banner struct {
Uri string `json:"uri"`
BodyHash int32 `json:"body_hash"`
Body string `json:"body"`
Header string `json:"header"`
Headers map[string]string `json:"-"`
Title string `json:"title"`
StatusCode int `json:"status_code"`
Response string `json:"_"`
SSL bool `json:"ssl"`
Certificate string `json:"certificate"`
IconHash int32 `json:"icon_hash"`
IconType string `json:"icon_type"`
Charset string `json:"-"`
Cert *tls.ConnectionState `json:"-"`
IconURI string `json:"icon_uri"`
IconBytes []byte `json:"-"`
Compliance map[string]string `json:"-"`
}
Banner 表示爬取的网站信息
func RequestOnce
deprecated
func RequestOnce(ctx context.Context, client *retryablehttp.Client, uri string, options ...*Options) (banner *Banner, redirectURL string, err error)
RequestOnce performs one HTTP request cycle and returns a banner plus a client-side redirect URL when one is detected.
Deprecated: prefer Fetcher.GetBanners or Fetcher.GetBanner for stable public use. This low-level helper is kept for compatibility.
func (*Banner) CacheLower ¶
func (b *Banner) CacheLower()
缓存小写内容、避免匹配时进行大小写转换出现的性能损耗、虽然会增加内存开销、但是可以显著提高匹配速度
Click to show internal directories.
Click to hide internal directories.