Change strings to look for in HTML. Chores.
This commit is contained in:
parent
6122f74e99
commit
639de7c602
1 changed files with 12 additions and 13 deletions
|
|
@ -1,16 +1,18 @@
|
||||||
import sys
|
import logging
|
||||||
|
|
||||||
sys.path.append("..")
|
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
|
from core.config import refresher_delay
|
||||||
from db_layer.capturas_interface import capturas_interface
|
from db_layer.capturas_interface import capturas_interface
|
||||||
from db_layer.capturing_tasks_interface import capturing_interface
|
from db_layer.capturing_tasks_interface import capturing_interface
|
||||||
from core.config import refresher_delay
|
|
||||||
from core import my_logger
|
|
||||||
import logging
|
|
||||||
|
|
||||||
|
|
||||||
class Refresher:
|
class Refresher:
|
||||||
def start(self):
|
@staticmethod
|
||||||
|
def start() -> None:
|
||||||
|
"""
|
||||||
|
Execute main flow.
|
||||||
|
:return: None
|
||||||
|
"""
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
sleep(refresher_delay)
|
sleep(refresher_delay)
|
||||||
|
|
@ -28,13 +30,10 @@ class Refresher:
|
||||||
:param html: HTML del anuncio en string.
|
:param html: HTML del anuncio en string.
|
||||||
:return: True si esta dado de baja, False si no.
|
:return: True si esta dado de baja, False si no.
|
||||||
"""
|
"""
|
||||||
try:
|
if "anunciante" in html and "baja" in html:
|
||||||
if ":-|" in html or "El anunciante lo dio de baja" in html:
|
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
except TypeError:
|
|
||||||
return False
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue