self.ip=requests.get('http:ip获取') self.ip=(self.ip.text).replace(' ','').replace(' ','') print('IP是', self.ip) self.proxies={'https':self.ip} response=requests.get(url,headers=self.headers,proxies=self.proxies)