答案 0 :(得分:2)
经过几个小时的搜索,我们终于找到了一种获取自动代理配置的方法。
# -*- coding: utf-8 -*-
try:
import SystemConfiguration
config = SystemConfiguration.SCDynamicStoreCopyProxies(None)
if all(('ProxyAutoConfigEnable' in config,'ProxyAutoConfigURLString' in config, not config.get('ProxyAutoDiscoveryEnable', 0))):
print str(config['ProxyAutoConfigURLString'])
except Exception, e:
print e