Commit c247aa3b authored by anqi-wmm's avatar anqi-wmm

生产 sensor_data

测试成功
parent c6258462
......@@ -50,10 +50,10 @@ func abckSensor(client tls_client.HttpClient, sensorurl string) string {
req.Header.Set("referer", "https://www.spirit.com/")
req.Header.Set("user-agent", rsss[1])
resp, _ := client.Do(req)
readBytes, _ := io.ReadAll(resp.Body)
fmt.Println(string(readBytes))
//readBytes, _ := io.ReadAll(resp.Body)
//fmt.Println(string(readBytes))
for _, cookie := range resp.Cookies() {
fmt.Println(cookie.Name, len(cookie.Value), cookie.Value)
fmt.Println(cookie.Name, len(cookie.Value))
}
ua = rsss[1]
}
......@@ -62,7 +62,7 @@ func abckSensor(client tls_client.HttpClient, sensorurl string) string {
func main() {
wg := &sync.WaitGroup{}
for i := 0; i < 1; i++ {
for i := 0; i < 10; i++ {
wg.Add(1)
go func() {
jar := tls_client.NewCookieJar()
......@@ -80,12 +80,12 @@ func main() {
fmt.Println(px)
options := []tls_client.HttpClientOption{
tls_client.WithTimeoutSeconds(30),
tls_client.WithClientProfile(tls_client.Chrome_110),
tls_client.WithClientProfile(tls_client.Chrome_108),
tls_client.WithNotFollowRedirects(),
tls_client.WithCookieJar(jar), // create cookieJar instance and pass it as argument
tls_client.WithProxyUrl("http://127.0.0.1:8890"),
//tls_client.WithProxyUrl("http://user-unifflcc-region-us:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600"),
//tls_client.WithProxyUrl(px),
//tls_client.WithProxyUrl("http://127.0.0.1:8890"),
tls_client.WithProxyUrl("http://user-unifflcc-region-us:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600"),
tls_client.WithProxyUrl(px),
tls_client.WithInsecureSkipVerify(),
}
client, err := tls_client.NewHttpClient(tls_client.NewNoopLogger(), options...)
......@@ -104,7 +104,7 @@ func main() {
req.Header.Set("accept-language", "en-US,en;q=0.9")
req.Header.Set("User-Agent", "Mozilla/5.0 (Linux; Android 9; SM-N9500) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Mobile Safari/537.36")
resp, _ := client.Do(req)
fmt.Println(resp.StatusCode)
doc, err := goquery.NewDocumentFromReader(resp.Body)
if err != nil {
panic(err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment