Mercurial > ~darius > hgwebdir.cgi > scrape-gm
changeset 6:5058c2695109
Properly report if we can't parse the results.
author | darius |
---|---|
date | Sun, 18 Nov 2007 08:54:07 +0000 |
parents | 294581b9c72f |
children | 825302e32c35 eec2fc32ca88 |
files | scrape-gm.py |
diffstat | 1 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/scrape-gm.py Fri Oct 19 07:53:00 2007 +0000 +++ b/scrape-gm.py Sun Nov 18 08:54:07 2007 +0000 @@ -5,7 +5,7 @@ # # Prints out matched player names agreated by server # -# $Id: scrape-gm.py,v 1.2 2007/10/19 07:53:00 darius Exp $ +# $Id: scrape-gm.py,v 1.3 2007/11/18 08:54:07 darius Exp $ ############################################################################ # # Copyright (C) 2007 Daniel O'Connor. All rights reserved. @@ -100,7 +100,7 @@ playertbl = s.find("table", "search_table") if (playertbl == None): - print "Unable to find results" + #print "Unable to find results" return None servertbl = playertbl.findNext("table", "search_table") @@ -153,7 +153,9 @@ servers = Server.Scrape(f) del f - if (len(servers) == 0): + if (servers == None): + print "No results available, please check manually" + elif (len(servers) == 0): print "No players found" else: i = 0