Change strings to look for in HTML. Chores.

This commit is contained in:
pablo 2021-01-04 22:29:01 +01:00
parent 6122f74e99
commit 639de7c602

View file

@ -1,16 +1,18 @@
import sys
sys.path.append("..")
import logging
from time import sleep
from core.config import refresher_delay
from db_layer.capturas_interface import capturas_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:
def start(self):
@staticmethod
def start() -> None:
"""
Execute main flow.
:return: None
"""
while True:
sleep(refresher_delay)
@ -28,13 +30,10 @@ class Refresher:
:param html: HTML del anuncio en string.
:return: True si esta dado de baja, False si no.
"""
try:
if ":-|" in html or "El anunciante lo dio de baja" in html:
if "anunciante" in html and "baja" in html:
return True
else:
return False
except TypeError:
return False
if __name__ == "__main__":