使用golang+代理IP+goquery开发爬虫(爬取国外电影网站)

package main

import (
        "fmt"
        "github.com/PuerkitoBio/goquery"
        "net/http"
        "net/url"
        "time"
        "strconv"
        "strings"
        "log"
)

func main() {
	for k:= 206044;k<300000;k++{
		Bluray(k)
	}
	
}


func Between(str, starting, ending string) string {
    s := strings.Index(str, starting)
    if s < 0 {
        return ""
    }
    s += len(starting)
    e := strings.Index(str[s:], ending)
    if e < 0 {
        return ""
    }
    return str[s : s+e]
}

func Bluray(i int){
		
	        req_url := "https://www.blu-ray.com/movies/The-Meg-4K-Blu-ray/" + strconv.Itoa(i)
	LABEL1:        
			fmt.Println("start id:",i)
	
			ipAddress := httpGet()//这里获取代理IP 返回eg:127.0.0.1

你可能感兴趣的:(爬虫,golang,php)