MPMG-DCC-UFMG / C01

Coleta de Dados Públicos
GNU General Public License v3.0
18 stars 9 forks source link

Inconsistência no passo `digite` #7499

Closed elvesmrodrigues closed 1 year ago

elvesmrodrigues commented 1 year ago

Comportamento Esperado

O passo não deve ter bugs.

Comportamento Atual

O passo insere texto incorreto nos inputs de páginas, como mostrado na seguinte figura, onde no primeiro input o texto deveria ser 10/12/2015:

image

Especificações da Coleta

{
  "source_name": "[Realiza\u00e7\u00e3o-F01] Coleta de Contratos de Serra do Salitre",
  "base_url": "http://187.62.86.129:8444/transparencia/",
  "obey_robots": false,
  "data_path": "/datalake/ufmg/webcrawlerc01/realizacaof01/serra_do_salitre/contratos",
  "request_type": "GET",
  "form_request_type": "POST",
  "antiblock_download_delay": 2,
  "antiblock_autothrottle_enabled": false,
  "antiblock_autothrottle_start_delay": 2,
  "antiblock_autothrottle_max_delay": 10,
  "antiblock_ip_rotation_enabled": false,
  "antiblock_ip_rotation_type": "tor",
  "antiblock_max_reqs_per_ip": 10,
  "antiblock_max_reuse_rounds": 10,
  "antiblock_proxy_list": "",
  "antiblock_user_agent_rotation_enabled": false,
  "antiblock_reqs_per_user_agent": 100,
  "antiblock_user_agents_list": "",
  "antiblock_insert_cookies_enabled": false,
  "antiblock_cookies_list": "",
  "captcha": "none",
  "has_webdriver": false,
  "webdriver_path": null,
  "img_xpath": null,
  "sound_xpath": null,
  "dynamic_processing": true,
  "skip_iter_errors": false,
  "explore_links": false,
  "link_extractor_max_depth": null,
  "link_extractor_allow_url": null,
  "link_extractor_allow_domains": null,
  "link_extractor_tags": null,
  "link_extractor_attrs": null,
  "link_extractor_check_type": false,
  "link_extractor_process_value": "",
  "download_files": false,
  "download_files_allow_url": null,
  "download_files_allow_extensions": null,
  "download_files_allow_domains": null,
  "download_files_tags": null,
  "download_files_attrs": null,
  "download_files_process_value": "",
  "download_files_check_large_content": true,
  "download_imgs": false,
  "steps": "{\"step\":\"root\",\"depth\":0,\"children\":[{\"step\":\"espere\",\"depth\":1,\"arguments\":{\"segundos\":\"4\"}},{\"step\":\"screenshot\",\"depth\":1,\"arguments\":{}},{\"step\":\"clique\",\"depth\":1,\"arguments\":{\"elemento\":\"\\\"(//a[@href='/transparencia/paginas/publico/lei12527/contratos/consultarContrato.xhtml'])[*]\\\"\"}},{\"step\":\"espere\",\"depth\":1,\"arguments\":{\"segundos\":\"4\"}},{\"step\":\"screenshot\",\"depth\":1,\"arguments\":{}},{\"step\":\"para_cada\",\"depth\":1,\"iterator\":\"ano\",\"children\":[{\"step\":\"digite\",\"depth\":2,\"arguments\":{\"xpath\":\"\\\"/html/body/div[4]/div/div/div/div/form/div/div/div/div[2]/div/input[1]\\\"\",\"texto\":\"f\\\"01/01/{ano}\\\"\"}},{\"step\":\"espere\",\"depth\":2,\"arguments\":{\"segundos\":\"4\"}},{\"step\":\"digite\",\"depth\":2,\"arguments\":{\"xpath\":\"\\\"/html/body/div[4]/div/div/div/div/form/div/div/div/div[2]/div/input[2]\\\"\",\"texto\":\"f\\\"31/12/{ano}\\\"\"}},{\"step\":\"espere\",\"depth\":2,\"arguments\":{\"segundos\":\"4\"}},{\"step\":\"clique\",\"depth\":2,\"arguments\":{\"elemento\":\"\\\"//button[@id='form-filtro:btnPesquisar']\\\"\"}},{\"step\":\"espere\",\"depth\":2,\"arguments\":{\"segundos\":\"6\"}},{\"step\":\"selecione\",\"depth\":2,\"arguments\":{\"xpath\":\"\\\"/html/body/div[4]/div/div/div/div/form/table/tbody/tr[1]/td/div/div[2]/select\\\"\",\"opcao\":\"\\\"50\\\"\"}},{\"step\":\"espere\",\"depth\":2,\"arguments\":{\"segundos\":\"4\"}},{\"step\":\"atribuicao\",\"depth\":2,\"target\":\"num_pags\",\"source\":{\"call\":{\"step\":\"objeto\",\"arguments\":{\"objeto\":\"\\\"0\\\"\"}}}},{\"step\":\"se\",\"depth\":2,\"children\":[{\"step\":\"atribuicao\",\"depth\":3,\"target\":\"num_pags\",\"source\":{\"call\":{\"step\":\"extrai_texto\",\"arguments\":{\"xpath\":\"\\\"//div[@id='form-filtro:data-table_paginator_bottom']/span[@class='ui-paginator-current']\\\"\"}}}},{\"step\":\"espere\",\"depth\":3,\"arguments\":{\"segundos\":\"2\"}},{\"step\":\"atribuicao\",\"depth\":3,\"target\":\"num_pags\",\"source\":{\"call\":{\"step\":\"objeto\",\"arguments\":{\"objeto\":\"num_pags.split()[3][:-1]\"}}}},{\"step\":\"espere\",\"depth\":3,\"arguments\":{\"segundos\":\"2\"}},{\"step\":\"imprime\",\"depth\":3,\"arguments\":{\"texto\":\"f\\\"Coletando dados de {ano}\\\"\"}},{\"step\":\"para_cada\",\"depth\":3,\"iterator\":\"pagina\",\"children\":[{\"step\":\"clique\",\"depth\":4,\"arguments\":{\"elemento\":\"\\\"/html/body/div[4]/div/div/div/div/form/table/tbody/tr[3]/td/a[4]/i\\\"\"}},{\"step\":\"espere\",\"depth\":4,\"arguments\":{\"segundos\":\"4\"}},{\"step\":\"imprime\",\"depth\":4,\"arguments\":{\"texto\":\"f\\\"Baixando pdf geral de {ano}\\\"\"}},{\"step\":\"para_cada\",\"depth\":4,\"iterator\":\"contrato\",\"children\":[{\"step\":\"clique\",\"depth\":5,\"arguments\":{\"elemento\":\"contrato\"}},{\"step\":\"espere\",\"depth\":5,\"arguments\":{\"segundos\":\"2\"}},{\"step\":\"screenshot\",\"depth\":5,\"arguments\":{}},{\"step\":\"salva_pagina\",\"depth\":5,\"arguments\":{}},{\"step\":\"espere\",\"depth\":5,\"arguments\":{\"segundos\":\"2\"}},{\"step\":\"imprime\",\"depth\":5,\"arguments\":{\"texto\":\"f\\\"Salvando contrato...\\\"\"}},{\"step\":\"se\",\"depth\":5,\"children\":[{\"step\":\"imprime\",\"depth\":6,\"arguments\":{\"texto\":\"f\\\"Baixando pdf contrato\\\"\"}},{\"step\":\"clique\",\"depth\":6,\"arguments\":{\"elemento\":\"\\\"//a[@href='#formVisualizar:tabContrato:tabDocumentos']\\\"\"}},{\"step\":\"espere\",\"depth\":6,\"arguments\":{\"segundos\":\"2\"}},{\"step\":\"screenshot\",\"depth\":6,\"arguments\":{}},{\"step\":\"para_cada\",\"depth\":6,\"iterator\":\"documento\",\"children\":[{\"step\":\"clique\",\"depth\":7,\"arguments\":{\"elemento\":\"documento\"}},{\"step\":\"espere\",\"depth\":7,\"arguments\":{\"segundos\":\"2\"}}],\"iterable\":{\"call\":{\"step\":\"localiza_elementos\",\"arguments\":{\"xpath\":\"\\\"(//button[@title='Baixar conte\u00fado'])[*]\\\"\"}}}}],\"condition\":{\"call\":{\"step\":\"elemento_existe_na_pagina\",\"arguments\":{\"xpath\":\"\\\"//a[@href='#formVisualizar:tabContrato:tabDocumentos']\\\"\"}}}},{\"step\":\"clique\",\"depth\":5,\"arguments\":{\"elemento\":\"\\\"/html/body/div[11]/div[1]/a\\\"\"}},{\"step\":\"espere\",\"depth\":5,\"arguments\":{\"segundos\":\"1\"}}],\"iterable\":{\"call\":{\"step\":\"localiza_elementos\",\"arguments\":{\"xpath\":\"\\\"/html/body/div[4]/div/div/div/div/form/table/tbody/tr[1]/td/div/div[1]/table/tbody/tr[*]/td[1]\\\"\"}}}}],\"iterable\":{\"call\":{\"step\":\"objeto\",\"arguments\":{\"objeto\":\"[i for i in range(1, int(num_pags)+1)]\"}}}},{\"step\":\"se\",\"depth\":3,\"children\":[{\"step\":\"imprime\",\"depth\":4,\"arguments\":{\"texto\":\"f\\\"Pr\u00f3xima p\u00e1gina\\\"\"}},{\"step\":\"clique\",\"depth\":4,\"arguments\":{\"elemento\":\"\\\"/html/body/div[4]/div/div/div/div/form/table/tbody/tr[1]/td/div/div[2]/a[3]\\\"\"}},{\"step\":\"espere\",\"depth\":4,\"arguments\":{\"segundos\":\"4\"}}],\"condition\":{\"call\":{\"step\":\"for_clicavel\",\"arguments\":{\"xpath\":\"\\\"/html/body/div[4]/div/div/div/div/form/table/tbody/tr[1]/td/div/div[2]/a[3]\\\"\"}}}}],\"condition\":{\"call\":{\"step\":\"elemento_existe_na_pagina\",\"arguments\":{\"xpath\":\"\\\"//div[@id='form-filtro:data-table_paginator_bottom']/span[@class='ui-paginator-current']\\\"\"}}}}],\"iterable\":{\"call\":{\"step\":\"objeto\",\"arguments\":{\"objeto\":\"[n for n in range(2015,2022)]\"}}}},{\"step\":\"screenshot\",\"depth\":1,\"arguments\":{}}]}",
  "encoding_detection_method": 1,
  "expected_runtime_category": "medium",
  "templated_url_parameter_handlers": [],
  "static_form_parameter_handlers": [],
  "templated_url_response_handlers": [],
  "static_form_response_handlers": [],
  "crawler_id": 5955,
  "instance_id": "166321278249354"
}

Sistema (caso necessário)

elvesmrodrigues commented 1 year ago

A issue #7758 é exatamente a mesma.