def set_proxy(self, proxy):
    proxy_url = QUrl(proxy)
if str(proxy_url.scheme()).startswith('http'):
    protocol = QNetworkProxy.HttpProxy
else:
    pass
PyQt: how to use QWebPage with an anonimous proxy