Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.04; 'doing?': 0.09; 'filter,': 0.09; 'finished.': 0.09; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'url:github': 0.09; 'python': 0.11; 'language.': 0.14; 'programmer,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:when': 0.16; 'skip:# 20': 0.16; 'language': 0.16; 'wrote:': 0.18; 'library': 0.18; 'passing': 0.19; 'meant': 0.20; 'help.': 0.21; 'import': 0.22; 'print': 0.22; 'load': 0.23; 'header:User-Agent:1': 0.23; 'code:': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; "doesn't": 0.30; "i'm": 0.30; 'code': 0.31; "skip:' 10": 0.31; 'fault': 0.31; 'file': 0.32; 'could': 0.34; 'subject:with': 0.35; 'skip:u 20': 0.35; 'google': 0.35; 'there': 0.35; 'url:org': 0.36; 'project': 0.37; 'skip:o 20': 0.38; 'displays': 0.38; 'filter': 0.38; 'skip:[ 10': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'received:org': 0.40; 'skip:u 10': 0.60; "you've": 0.63; 'our': 0.64; 'here': 0.66; 'webpage': 0.68; 'link:': 0.72; 'subject:try': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: BLANK PAGE when i try Filtering Adsense with abpy Date: Sun, 22 Dec 2013 18:25:17 +0000 References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-78-146-15-252.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 48 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1387736733 news.xs4all.nl 2969 [2001:888:2000:d::a6]:40253 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:62539 On 22/12/2013 17:20, em rexhepi wrote: > I know is my fault i'm no good programmer, I'm a begginer that's why i need your help. > > I have a python 3.3 project to be finished. I did what i could there is not much help on google about this topic. > > The project is to load a webpage from any website and filter the ads. > I'm using ABPY library to filter, here is the link: > https://github.com/atereshkin/abpy <- needs to be converted in python 3.x it is on 2.x > easylist.txt link: https://easylist-downloads.adblockplus.org/easylist.txt > > > When I use my code it just displays nothing > > My code: > #!/usr/local/bin/python3.1 > > import cgitb;cgitb.enable() > > import urllib.request > response = urllib.request.build_opener() > response.addheaders = [('User-agent', 'Mozilla/5.0')] > response = urllib.request.urlopen("www.youtube.com";) > > html = response.read() > > from abpy import Filter > with open("easylist.txt") as f: > f = Filter(file('easylist.txt')) > f.match(html) Whats the above meant to be doing? You've opened easylist.txt as f and then reassigned f, passing easylist.txt to file which doesn't exist in Python 3. > > > print("Content-type: text/html") > print() > print (html) > -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence