Have you ever used goquery? I want to use an agent to crawl. Does goquery support it? I looked for it and didn't seem to find it.

have you ever used goquery? I want to use an agent to crawl. Does goquery support it? After looking for it, I don"t seem to find

.
Feb.27,2021

you are thinking in the wrong direction (wrong posture). goquery is not a universal toolkit.

the correct pose should be to call the net/http method, then set the proxy
and then use NewDocumentFromReader to read res.Body

in goquery . The code form of

can refer to the official examples
and think of it as components together


turn

 proxy, _ := url.Parse("http://x.x.x.x:8080")

    tr := &http.Transport{
        Proxy:           http.ProxyURL(proxy),
        TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
    }

    client := &http.Client{
        Transport: tr,
        Timeout:   time.Second * 5,
    }

    resp, err := client.Get("http://www.qiushibaike.com")
    if err != nil {
        fmt.Println(err)
        return
    }

    doc, err := goquery.NewDocumentFromResponse(resp)
    if err != nil {
        fmt.Println(err)
        return
    }

two recommendations are recommended for learning crawlers:
https://github.com/henrylee2c. (heavyweight)

http://go-colly.org/ (small)

are all useful to goquery, dialects, go crawlers basically use goquery,selector, etc., and are basically required to learn

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-16de3f6-88d5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-16de3f6-88d5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?