I am working on a project with JavaScript and chose Puppeteer to perform web scraping on various websites. One of the websites I need to scrape is this one Mapas SII, from which I plan to obtain information using a property's ROL (a public identifier for properties in Chile). This information is publicly accessible and can be queried using other public data.
The problem is that I am unable to select or type in the "Comuna" (municipality) input field. I have tried different approaches, such as:
I tried filling out the form with these variations, but none of them seem to work. The 'Comuna' field is the only complex one because 'Manzana' and 'Predio' were easy to fill.
const selectorComuna = 'input[data-ng-model="nombreComuna"]';
await this.page.focus(selectorComuna);
await this.page.keyboard.type("MAI", { delay: 100 });
this.page.type(selectorComuna, "MAIPU", { delay: 100 });
await this.page.evaluate(() => {
const comunaInput = document.querySelector('input[data-ng-model="nombreComuna"]');
comunaInput.value = 'MAIPÚ';
comunaInput.dispatchEvent(new Event('input', { bubbles: true }));
});
await this.page.locator(selectorComuna).fill(thisuna);
And none work. PD: Sorry for grammar errorsEnglish is not my first language.