Corregidos pequeños errores y type tras primer test del servicio.
This commit is contained in:
parent
1f372b85b6
commit
80d65b7a7c
3 changed files with 68 additions and 153 deletions
|
|
@ -5,19 +5,20 @@ ads_root = 'https://www.idealista.com/inmueble/'
|
|||
|
||||
def create_capturing_task(referencia, db_wrapper, uuid_exploring=None):
|
||||
|
||||
query_parameters = {'url': ads_root + referencia,
|
||||
query_parameters = {'ad_url': ads_root + referencia,
|
||||
'uuid': str(uuid.uuid4()),
|
||||
'status': 'Pending'}
|
||||
|
||||
if uuid_exploring is None:
|
||||
query_statement = """INSERT INTO capturing_tasks_logs
|
||||
(uuid, write_time, status, url)
|
||||
VALUES (%(uuid)s, NOW(), %(status)s, url)"""
|
||||
VALUES (%(uuid)s, NOW(), %(status)s, %(ad_url)s)"""
|
||||
else:
|
||||
query_parameters['uuid_exploring'] = uuid_exploring
|
||||
query_statement = """INSERT INTO capturing_tasks_logs
|
||||
(uuid, write_time, status, url, fk_uuid_exploring)
|
||||
VALUES (%(uuid)s, NOW(), %(status)s, url, %(uuid_exploring))s"""
|
||||
query_parameters['uuid_exploring'] = uuid_exploring
|
||||
VALUES (%(uuid)s, NOW(), %(status)s, %(ad_url)s, %(uuid_exploring)s)"""
|
||||
|
||||
|
||||
db_wrapper.query(query_statement, query_parameters)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue