# -*- coding: cp936 -*- #PYTHON 27 #xiaodeng #获取微信服务器的ip地址 import urllib url=‘https://api.weixin.qq.com/cgi-bin/getcallbackip‘ data={‘access_token‘:‘VchuOKNr8X9tZVDrY_yG9qiJus_1nO1a7uT_iwWVwgGFdzPhPyaqreTE_qMKPas4SwRNif5k0A1zVw6Y9eTPI4CAYiUwpJvHdBt4fzDTRP4DWMiAFASLB‘} data=urllib.urlencode(data) html=urllib.urlopen(url,data) html=html.read() print html ‘‘‘ {"ip_list": ["101.226.62.77", "101.226.62.78", "101.226.62.79","101.226.62.80","101.226.62.81", "101.226.62.82","101.226.62.83","101.226.62.84", "101.226.62.85","101.226.62.86","101.226.103.59", "101.226.103.60","101.226.103.61","101.226.103.62", "101.226.103.63","101.226.103.69","101.226.103.70", "101.226.103.71","101.226.103.72","101.226.103.73", "140.207.54.73","140.207.54.74","140.207.54.75", "140.207.54.76","140.207.54.77","140.207.54.78", "140.207.54.79","140.207.54.80","182.254.11.203", "182.254.11.202","182.254.11.201","182.254.11.200", "182.254.11.199","182.254.11.198"]} ‘‘‘