From 96912b388547712ca978178a8cccfa789ccbdef4 Mon Sep 17 00:00:00 2001 From: dgbhp Date: Wed, 1 Jun 2016 12:32:23 +0800 Subject: [PATCH] Update scraper.py --- scraper.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/scraper.py b/scraper.py index c566622..4033670 100644 --- a/scraper.py +++ b/scraper.py @@ -30,6 +30,7 @@ #alignment=0 #vesselflag=1 colcnt=0 +recd=0 ColList = [0, 10.5, 1.26,1.14,1.12,1.12,1.08,1.13,1.1,1.09,1.08,1.07,1.04,1.05]; for tuple in tuples: @@ -57,15 +58,17 @@ prevloc=loc else: print 'PrevLoc: ' + str(prevloc) + ' Loc: ' + str(loc) + ' Calc: ' + str(float(loc/prevloc)) + ' ListVal: ' + str(float(ColList[colcnt])) - if loc/prevloc >= ColList[colcnt]-.1 and loc/prevloc <= ColList[colcnt]+.1: - print 'AllOtherValidCols: ' + obj - lineout = lineout + obj + ',' - colcnt=colcnt+1 - prevloc=loc - elif loc/prevloc > ColList[colcnt]+.1: - lineout = lineout + ',' - prevloc=prevloc*ColList[colcnt] - colcnt=colcnt+1 + while recd==0: + if loc/prevloc >= ColList[colcnt]-.1 and loc/prevloc <= ColList[colcnt]+.1: + print 'AllOtherValidCols: ' + obj + lineout = lineout + obj + ',' + colcnt=colcnt+1 + prevloc=loc + recd=1 + elif loc/prevloc > ColList[colcnt]+.1: + lineout = lineout + ',' + prevloc=prevloc*ColList[colcnt] + colcnt=colcnt+1 #elif loc/prevloc < ColList[colcnt]-.1 if colcnt == 14: