logic error when pubdate not found
This commit is contained in:
@@ -5,7 +5,7 @@ from enum import Enum
|
||||
import re
|
||||
from dateconverter import *
|
||||
from datetime import datetime
|
||||
DEBUG = False
|
||||
DEBUG = True
|
||||
|
||||
def log(*s):
|
||||
if DEBUG:
|
||||
@@ -51,7 +51,6 @@ class job():
|
||||
self.link = link
|
||||
self.tag = tag
|
||||
self.starred = starred
|
||||
|
||||
def __str__(self):
|
||||
return "%s| %s|%s|%s|%s|%s|%s" % (self.title,self.profession,self.company,self.location,self.date,self.description,self.link)
|
||||
|
||||
@@ -72,7 +71,7 @@ def finder(results,item,**modes):
|
||||
log(item.tag_content)
|
||||
else:
|
||||
result = entry.findAll(item.tag,class_=item.tag_content)
|
||||
log("found:",len(result))
|
||||
log("found count count results:",len(result))
|
||||
if result:
|
||||
log("theres a result")
|
||||
if i>(len(result)-1):
|
||||
@@ -99,7 +98,8 @@ def finder(results,item,**modes):
|
||||
if CLEANDATE or SWAPDATE:
|
||||
today = datetime.today().strftime('%Y-%M-%D')
|
||||
content.append(today)
|
||||
content.append("NOTFound")
|
||||
else:
|
||||
content.append("NOTFound")
|
||||
return content
|
||||
|
||||
|
||||
@@ -114,10 +114,10 @@ def arrayToClass(titles,companys,locations,dates,links,tag):
|
||||
log("len:",len(titles))
|
||||
for i, title in enumerate(titles):
|
||||
jobs.append(job(title,"test_prof",companys[i],locations[i],dates[i],"test_desc",links[i],tag,0))
|
||||
log(jobs[i])
|
||||
log("class job:",jobs[i])
|
||||
return jobs
|
||||
else:
|
||||
print("Something went wrong unequal length of data arrays")
|
||||
print("Something went wrong unequal length of data arrays: ",len(titles),len(companys),len(locations),len(dates))
|
||||
return 0
|
||||
def jobs_ch_clean_date(date):
|
||||
newdate=''
|
||||
|
||||
Reference in New Issue
Block a user