Subversion Repositories SmartDukaan

Rev

Rev 16210 | Rev 16212 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 16210 Rev 16211
Line 173... Line 173...
173
                    pagination = pagination + 1
173
                    pagination = pagination + 1
174
                    try:
174
                    try:
175
                        br.open(AFF_REPORT_URL % (status, syester5date, syester5date, pagination))
175
                        br.open(AFF_REPORT_URL % (status, syester5date, syester5date, pagination))
176
                    except:
176
                    except:
177
                        tprint("Could not fetch data for Status %s and date %s and pagination %s"%(status, syester5date, pagination))
177
                        tprint("Could not fetch data for Status %s and date %s and pagination %s"%(status, syester5date, pagination))
-
 
178
                        continue
178
                    page = ungzipResponse(br.response())
179
                    page = ungzipResponse(br.response())
179
                    soup = BeautifulSoup(page,convertEntities=BeautifulSoup.HTML_ENTITIES)
180
                    soup = BeautifulSoup(page,convertEntities=BeautifulSoup.HTML_ENTITIES)
180
                    soup.table
181
                    soup.table
181
                    try:
182
                    try:
182
                        tableElement = soup.findAll('table', {'class':'report-table fixtable'})[1]
183
                        tableElement = soup.findAll('table', {'class':'report-table fixtable'})[1]
183
                    except:
184
                    except:
184
                        break
185
                        break
185
                    trElements = tableElement.findAll('tr')
186
                    trElements = tableElement.findAll('tr')
186
                    trElements.pop(0)
187
                    trElements.pop(0)
187
                    tprint("Successfully updated fetch data for Status %s and date %s and pagination %s"%(status, syester5date, pagination))
-
 
188
                    for trElement in trElements:
188
                    for trElement in trElements:
189
                        tdElements = trElement.findAll('td')
189
                        tdElements = trElement.findAll('td')
190
                        if tdElements[0].text.strip()=='No Products to display!':
190
                        if tdElements[0].text.strip()=='No Products to display!':
191
                            hasPagination = False
191
                            hasPagination = False
192
                            continue
192
                            continue