Olá, escrevi uma código que posta anúncios na plataforma OLX. Porem a plataforma incluiu um captchua ao final do formulário. Preciso capturar o código da imagem (que é variável) e colar no campo captchua resolvendo. segue abaixo meu código e print da pagina.
{
"Name": "OLX Completo",
"CreationDate": "2023-7-31",
"Commands": [
{
"Command": "open",
"Target": "https://www2.olx.com.br/ai/form/0/",
"Value": "",
"Description": ""
},
{
"Command": "csvRead",
"Target": "readcsvtestdata.csv",
"Value": "",
"Description": ""
},
{
"Command": "store",
"Target": "fast",
"Value": "",
"Description": ""
},
{
"Command": "store",
"Target": "!COL1",
"Value": "",
"Description": ""
},
{
"Command": "store",
"Target": "!COL2",
"Value": "",
"Description": ""
},
{
"Command": "store",
"Target": "!COL3",
"Value": "",
"Description": ""
},
{
"Command": "click",
"Target": "id=category_item-1000",
"Value": "",
"Description": ""
},
{
"Command": "click",
"Target": "id=category_item-1100",
"Value": "",
"Description": ""
},
{
"Command": "click",
"Target": "id=subject",
"Value": "",
"Targets": [
"id=subject",
"name=subject",
"xpath=//*[@id=\"subject\"]",
"xpath=//input[@id='subject']",
"xpath=//input",
"css=#subject"
],
"Description": ""
},
{
"Command": "type",
"Target": "id=subject",
"Value": " ${!COL1}",
"Description": ""
},
{
"Command": "click",
"Target": "id=body",
"Value": "",
"Description": ""
},
{
"Command": "type",
"Target": "id=body",
"Value": " TERRENOS DE 500m² e 1000m² \\n Lotes para formar chácara ou casa de Campo \\n Terreno com vista para o lago \\n Muito próximo do centro da cidade, na beira do asfalto... \\n Direto com o proprietario sem burocracia. \\n Aceitamos carro ou moto como parte de pagamento \\n \\n \\n Para maiores informações: (11) 9.8.2.8.6-7.8.7.5",
"Description": ""
},
{
"Command": "click",
"Target": "/html/body/div/div[3]/form/div/div[1]/div/div[1]/fieldset[1]/div[1]/label/div/div/span[1]/span",
"Value": "",
"Targets": [
"xpath=//*[@id=\"root\"]/div[3]/form/div/div/div/fieldset/div/label/span/span",
"xpath=//span/span",
"css=#root > div:nth-child(4) > form > div.content-wrapper > div > div:nth-child(1) > fieldset.sc-cJSrbW.jZqdAT > div:nth-child(2) > label > span.sc-gPEVay.gFLdZS > span"
],
"Description": ""
},
{
"Command": "click",
"Target": "id=size",
"Value": "",
"Targets": [
"id=size",
"name=size",
"xpath=//*[@id=\"size\"]",
"xpath=//input[@id='size']",
"xpath=//div[3]/div/span/input",
"css=#size"
],
"Description": ""
},
{
"Command": "type",
"Target": "id=size",
"Value": "600",
"Targets": [
"id=size",
"name=size",
"xpath=//*[@id=\"size\"]",
"xpath=//input[@id='size']",
"xpath=//div[3]/div/span/input",
"css=#size"
],
"Description": ""
},
{
"Command": "click",
"Target": "id=re_land_type",
"Value": "",
"Description": ""
},
{
"Command": "select",
"Target": "id=re_land_type",
"Value": "label=Terrenos e lotes",
"Description": ""
},
{
"Command": "click",
"Target": "id=re_land_type",
"Value": "",
"Description": ""
},
{
"Command": "type",
"Target": "id=condominio",
"Value": "0,00",
"Description": ""
},
{
"Command": "click",
"Target": "xpath=//*[@id=\"root\"]/div[3]/form/div/div/div/div/fieldset[2]/div/label/span/span",
"Value": "",
"Targets": [
"xpath=//*[@id=\"root\"]/div[3]/form/div/div/div/div/fieldset[2]/div/label/span/span",
"xpath=//label/span/span",
"css=#root > div:nth-child(4) > form > div > div.content-wrapper > div > div:nth-child(1) > fieldset.sc-eHgmQL.iOoZZY > div > label:nth-child(1) > span.sc-cSHVUG.bqubxW > span"
],
"Description": ""
},
{
"Command": "click",
"Target": "xpath=//*[@id=\"root\"]/div[3]/form/div/div/div/div/fieldset[2]/div/label[3]/span/span",
"Value": "",
"Targets": [
"xpath=//*[@id=\"root\"]/div[3]/form/div/div/div/div/fieldset[2]/div/label[3]/span/span",
"xpath=//label[3]/span/span",
"css=#root > div:nth-child(4) > form > div > div.content-wrapper > div > div:nth-child(1) > fieldset.sc-eHgmQL.iOoZZY > div > label:nth-child(3) > span.sc-cSHVUG.bqubxW > span"
],
"Description": ""
},
{
"Command": "click",
"Target": "xpath=//*[@id=\"root\"]/div[3]/form/div/div/div/div/fieldset[2]/div/label[5]/span/span",
"Value": "",
"Targets": [
"xpath=//*[@id=\"root\"]/div[3]/form/div/div/div/div/fieldset[2]/div/label[5]/span/span",
"xpath=//label[5]/span/span",
"css=#root > div:nth-child(4) > form > div > div.content-wrapper > div > div:nth-child(1) > fieldset.sc-eHgmQL.iOoZZY > div > label:nth-child(5) > span.sc-cSHVUG.bqubxW > span"
],
"Description": ""
},
{
"Command": "click",
"Target": "xpath=//*[@id=\"root\"]/div[3]/form/div/div/div/div/fieldset[2]/div/label[7]/span/span",
"Value": "",
"Targets": [
"xpath=//*[@id=\"root\"]/div[3]/form/div/div/div/div/fieldset[2]/div/label[7]/span/span",
"xpath=//label[7]/span/span",
"css=#root > div:nth-child(4) > form > div > div.content-wrapper > div > div:nth-child(1) > fieldset.sc-eHgmQL.iOoZZY > div > label:nth-child(7) > span.sc-cSHVUG.bqubxW > span"
],
"Description": ""
},
{
"Command": "click",
"Target": "xpath=//*[@id=\"root\"]/div[3]/form/div/div/div/div/fieldset[2]/div/label[9]/span/span",
"Value": "",
"Targets": [
"xpath=//*[@id=\"root\"]/div[3]/form/div/div/div/div/fieldset[2]/div/label[9]/span/span",
"xpath=//label[9]/span/span",
"css=#root > div:nth-child(4) > form > div > div.content-wrapper > div > div:nth-child(1) > fieldset.sc-eHgmQL.iOoZZY > div > label:nth-child(9) > span.sc-cSHVUG.bqubxW > span"
],
"Description": ""
},
{
"Command": "click",
"Target": "xpath=//*[@id=\"root\"]/div[3]/form/div/div/div/div/fieldset[2]/div/label[2]/span/span",
"Value": "",
"Targets": [
"xpath=//*[@id=\"root\"]/div[3]/form/div/div/div/div/fieldset[2]/div/label[2]/span/span",
"xpath=//label[2]/span/span",
"css=#root > div:nth-child(4) > form > div > div.content-wrapper > div > div:nth-child(1) > fieldset.sc-eHgmQL.iOoZZY > div > label:nth-child(2) > span.sc-cSHVUG.bqubxW > span"
],
"Description": ""
},
{
"Command": "click",
"Target": "xpath=//*[@id=\"root\"]/div[3]/form/div/div/div/div/fieldset[2]/div/label[4]/span/span",
"Value": "",
"Targets": [
"xpath=//*[@id=\"root\"]/div[3]/form/div/div/div/div/fieldset[2]/div/label[4]/span/span",
"xpath=//label[4]/span/span",
"css=#root > div:nth-child(4) > form > div > div.content-wrapper > div > div:nth-child(1) > fieldset.sc-eHgmQL.iOoZZY > div > label:nth-child(4) > span.sc-cSHVUG.bqubxW > span"
],
"Description": ""
},
{
"Command": "click",
"Target": "xpath=//*[@id=\"root\"]/div[3]/form/div/div/div/div/fieldset[2]/div/label[6]/span/span",
"Value": "",
"Targets": [
"xpath=//*[@id=\"root\"]/div[3]/form/div/div/div/div/fieldset[2]/div/label[6]/span/span",
"xpath=//label[6]/span/span",
"css=#root > div:nth-child(4) > form > div > div.content-wrapper > div > div:nth-child(1) > fieldset.sc-eHgmQL.iOoZZY > div > label:nth-child(6) > span.sc-cSHVUG.bqubxW > span"
],
"Description": ""
},
{
"Command": "click",
"Target": "xpath=//*[@id=\"root\"]/div[3]/form/div/div/div/div/fieldset[2]/div/label[8]/span/span",
"Value": "",
"Targets": [
"xpath=//*[@id=\"root\"]/div[3]/form/div/div/div/div/fieldset[2]/div/label[8]/span/span",
"xpath=//label[8]/span/span",
"css=#root > div:nth-child(4) > form > div > div.content-wrapper > div > div:nth-child(1) > fieldset.sc-eHgmQL.iOoZZY > div > label:nth-child(8) > span.sc-cSHVUG.bqubxW > span"
],
"Description": ""
},
{
"Command": "click",
"Target": "xpath=//*[@id=\"root\"]/div[3]/form/div/div/div/div/fieldset[2]/div/label[10]/span",
"Value": "",
"Targets": [
"xpath=//*[@id=\"root\"]/div[3]/form/div/div/div/div/fieldset[2]/div/label[10]/span",
"xpath=//label[10]/span",
"css=#root > div:nth-child(4) > form > div > div.content-wrapper > div > div:nth-child(1) > fieldset.sc-eHgmQL.iOoZZY > div > label:nth-child(10) > span.sc-cSHVUG.bqubxW"
],
"Description": ""
},
{
"Command": "type",
"Target": "id=price",
"Value": " ${!COL2}",
"Targets": [
"id=price",
"name=price",
"xpath=//*[@id=\"price\"]",
"xpath=//input[@id='price']",
"xpath=//div[7]/div/span/input",
"css=#price"
],
"Description": ""
},
{
"Command": "XClick",
"Target": "/html/body/div[1]/div[3]/form/div/div[1]/div/div[2]/div[1]/div[2]/div[2]/span[1]",
"Value": "",
"Description": ""
},
{
"Command": "XType",
"Target": "\"C:\\Users\\José Carlos\\Desktop\\CAMPOLIM\\0 (4).png\" \"C:\\Users\\José Carlos\\Desktop\\CAMPOLIM\\0 (5).png\" \"C:\\Users\\José Carlos\\Desktop\\CAMPOLIM\\0 (9).png\" \"C:\\Users\\José Carlos\\Desktop\\CAMPOLIM\\0 (10).png\" \"C:\\Users\\José Carlos\\Desktop\\CAMPOLIM\\0 (26).jpeg\" \"C:\\Users\\José Carlos\\Desktop\\CAMPOLIM\\0 (27).jpeg\"",
"Value": "",
"Description": ""
},
{
"Command": "XType",
"Target": "${KEY_ENTER}",
"Value": "",
"Description": ""
},
{
"Command": "comment",
"Target": "pause // 8000",
"Value": "",
"Description": ""
},
{
"Command": "type",
"Target": "id=zipcode",
"Value": "${!COL3}",
"Description": ""
},
{
"Command": "click",
"Target": "id=captchaAnswer",
"Value": "",
"Targets": [
"id=captchaAnswer",
"name=captchaAnswer",
"xpath=//*[@id=\"captchaAnswer\"]",
"xpath=//input[@id='captchaAnswer']",
"xpath=//div[2]/div/span/input",
"css=#captchaAnswer"
],
"Description": ""
},
{
"Command": "pause",
"Target": "8000",
"Value": "",
"Description": ""
},
{
"Command": "click",
"Target": "id=ad_insertion_submit_button",
"Value": "",
"Targets": [
"id=ad_insertion_submit_button",
"xpath=//*[@id=\"ad_insertion_submit_button\"]",
"xpath=//button[@id='ad_insertion_submit_button']",
"xpath=//form/div[2]/div/button",
"css=#ad_insertion_submit_button"
],
"Description": ""
},
{
"Command": "pause",
"Target": "4000",
"Value": "",
"Description": ""
}
]
}