title: How would you adblock using Python?
body: <p>I'm slowly building a <a href="http://github.com/regomodo/qtBrowser/tree/master" rel="nofollow noreferrer">web browser</a> in PyQt4 and like the speed i'm getting out of it. However, I want to combine easylist.txt with it. I believe adblock uses this to block http requests by the browser.</p>
  
  <p>How would you go about it using python/PyQt4?</p>
  
  <p>[edit1] Ok. I think i've setup Privoxy. I haven't setup any additional filters and it seems to work. The PyQt4 i've tried to use looks like this</p>
  
  <pre><code>self.proxyIP = "127.0.0.1"  
  self.proxyPORT= 8118  
  proxy = QNetworkProxy()  
  proxy.setType(QNetworkProxy.HttpProxy)  
  proxy.setHostName(self.proxyIP)  
  proxy.setPort(self.proxyPORT)  
  QNetworkProxy.setApplicationProxy(proxy)
  </code></pre>
  
  <p>However, this does absolutely nothing and I cannot make sense of the docs and can not find any examples.</p>
  
  <p>[edit2] I've just noticed that i'f I change self.proxyIP to my actual local IP rather than 127.0.0.1 the page doesn't load. So something is happening.</p>