typo results instead of result

add debugg logs
This commit is contained in:
ccppi 2024-07-22 10:54:28 +02:00
parent 315c1302cb
commit 0870255544

View File

@ -79,8 +79,9 @@ def finder(results,item,**modes):
else: else:
result = entry.findAll(item.tag,class_=item.tag_content) result = entry.findAll(item.tag,class_=item.tag_content)
log("found count results:",len(result)) log("found count results:",len(result))
if not result and DEBUG == True: if len(result)==0 and DEBUG == True:
for x in results: log("len result: ",len(result))
for x in result:
log("No entry found for: ",item.name,item.tag,item.tag_content," -->", x) log("No entry found for: ",item.name,item.tag,item.tag_content," -->", x)
input() input()
if result: if result:
@ -88,10 +89,9 @@ def finder(results,item,**modes):
if i>(len(result)-1): if i>(len(result)-1):
log("len:",len(result)-1,"i:",i) log("len:",len(result)-1,"i:",i)
log("index out of bounds fall back to the %d count",i) log("index out of bounds fall back to the %d count",i)
# input("Press Enter..")
i=(len(result)-1) i=(len(result)-1)
result2 = result[i] result2 = result[i]
if GETCHILDREN!='': if GETCHILDREN != '':
found = False found = False
for results in result: for results in result:
child = results.find(GETCHILDREN) child = results.find(GETCHILDREN)
@ -116,6 +116,7 @@ def finder(results,item,**modes):
elif CLEANDATE==1: elif CLEANDATE==1:
content.append(jobs_ch_clean_date(result2.text.strip())) content.append(jobs_ch_clean_date(result2.text.strip()))
else: else:
log(result2)
content.append(result2.text.strip()) content.append(result2.text.strip())
if not result: if not result:
if item.tag_content == "pubdate": if item.tag_content == "pubdate":