Documentation ¶
Index ¶
- Variables
- func GetURLEncode(sendURL string) string
- type Core
- func (t *Core) DELETE() *Core
- func (t *Core) DoResp() *Core
- func (t *Core) GET() *Core
- func (t *Core) PATCH() *Core
- func (t *Core) POST() *Core
- func (t *Core) PUT() *Core
- func (t *Core) Resp() *Core
- func (t *Core) ResultBody() io.ReadCloser
- func (t *Core) ResultBytes() (result []byte, err error)
- func (t *Core) ResultGoquery() *CoreGoquery
- func (t *Core) ResultJSON(result any) (err error)
- func (t *Core) ResultString() (result string, err error)
- type CoreGoquery
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MethodGet = "GET" MethodHead = "HEAD" MethodPost = "POST" MethodPut = "PUT" MethodPatch = "PATCH" // RFC 5789 MethodDelete = "DELETE" MethodConnect = "CONNECT" MethodOptions = "OPTIONS" MethodTrace = "TRACE" )
Functions ¶
Types ¶
type Core ¶
type Core struct { //请求地址 Url string //请求方法 Method string //参数集合 Body []byte Params url.Values //是否启动混淆头部 IsRandHeader bool //是否启动代理 IsProxy bool ProxyIP string //请求总结构体 Client *http.Client Request *http.Request //反馈结构体 Response *http.Response //错误信息 Err error RequestErr error ResponseErr error }
Core 构建器 外部所有声明需先构建此构建器,然后根据上下文使用后续
func (*Core) Resp ¶
Resp 获取RESP信息源 注意自行增加关闭机制 param getURL string 获取URL地址 param params url.Values 表单参数,只有post给定,留空则认定为get模式 param proxyIP string 代理IP地址,如果留空跳过 param isSetHeader bool 是否加入头信息加密,建议爬虫使用 return *http.Response,error 数据,错误
func (*Core) ResultBytes ¶
ResultBytes 获取byte数据
func (*Core) ResultGoquery ¶
func (t *Core) ResultGoquery() *CoreGoquery
ResultGoquery 通过goquery获取HTML return *goquery.Document , error 文档操作句柄,是否成功
func (*Core) ResultString ¶
ResultString 将结果转为字符串
type CoreGoquery ¶
func (*CoreGoquery) ResultGoqueryFindCount ¶
func (t *CoreGoquery) ResultGoqueryFindCount(findStr string) int
ResultGoqueryFindCount 获取HTML文档字符串长度
Click to show internal directories.
Click to hide internal directories.