[Lolix] add search management in basic search
This commit is contained in:
parent
9cf7f01dae
commit
abbfad7ba1
3 changed files with 11 additions and 7 deletions
|
|
@ -69,12 +69,17 @@ class AdvertPage(BasePage):
|
|||
|
||||
|
||||
class SearchPage(BasePage):
|
||||
def iter_job_adverts(self):
|
||||
def iter_job_adverts(self, pattern):
|
||||
rows = self.document.getroot().xpath('//td[@class="Contenu"]/table/tr')
|
||||
for row in rows:
|
||||
cols = self.is_row_advert(row)
|
||||
if cols is not None:
|
||||
yield self.create_job_advert(cols)
|
||||
advert = self.create_job_advert(cols)
|
||||
if pattern:
|
||||
if pattern in advert.title:
|
||||
yield advert
|
||||
else:
|
||||
yield advert
|
||||
|
||||
def is_row_advert(self, row):
|
||||
cols = self.parser.select(row, 'td')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue