为了账号安全,请及时绑定邮箱和手机立即绑定

为什么说get_ip_content 没有定义?

为什么说get_ip_content 没有定义?

明月笑刀无情 2018-07-11 14:05:56
from get_ip import *  response=requests.get(url=url,headers=headers,cookies=self.cookies,proxies=get_ip_content()) get_ip 类是这样的 #!/usr/bin env python3import requestsimport reimport randomdef get_ip_content():   response=requests.get('http://www.httpipqq.com/api.asp?sl=10&noinfo=true&ddbh=189483614300055720')   ip_list=re.findall('(\d+\.+\d+\.+\d+\.\d+:\d+)', response.text, re.S)   PROXIES = {         "http": "http://"+ip_list[random.randint(0,len(ip_list))],    "https": "http://"+ip_list[random.randint(0,len(ip_list))],     }  return PROXIES下面这样写报错?Traceback (most recent call last):File "wechat_official_accounts.py", line 85, in <module>wechat_offical_account().get_offical_account()File "wechat_official_accounts.py", line 36, in get_offical_accountresponse=requests.get(url=url,headers=headers,cookies=self.cookies,proxies=get_ip_content())NameError: name 'get_ip_content' is not defined为啥说我get_ip_content
查看完整描述

2 回答

?
幕布斯6054654

TA贡献1876条经验 获得超7个赞

这样写的确报错

get_ip.get_ip_content()# 了解一下


查看完整回答
反对 回复 2018-07-15
?
慕田峪7331174

TA贡献1828条经验 获得超13个赞

直接导入get_ip,用包名加函数名来调用。

import get_ipget_ip.get_ip_content()


查看完整回答
反对 回复 2018-07-15
  • 2 回答
  • 0 关注
  • 152 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信