Help scraping phone numbers from Mubawab listings (AJAX / “show phone” button)

Hi all — I’m stuck and need help scraping phone numbers from Mubawab listing pages. The listings render dynamically (AJAX) and the phone only appears after a JS action (a “show phone” button). I’ve tried calling public API endpoints and simple HTTP requests but the number never shows in the raw HTML response. iwill give you link of an example page if there is any recommandation please let me know :Apartment to purchase in Bourgogne Ouest. 2 beautiful rooms. Living room with Moroccan decor, General satellite dish system - Mubawab

Describe the problem/error/question

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

hey! yeah that phone button scraping thing is a classic problem. the issue is that mubawab loads the phone number via javascript after you click, so a basic HTTP request wont grab it.

here’s what i’d try:

**option 1: use puppeteer (best for this)**

1. grab the Puppeteer node from n8n

2. write a script that:

  • navigates to the listing page

  • waits for the page to load

  • clicks the “show phone” button

  • extracts the phone number from the DOM

  • returns it

something like:

```javascript

const puppeteer = require(‘puppeteer’);

(async () => {

const browser = await puppeteer.launch();

const page = await browser.newPage();

await page.goto(‘YOUR_URL_HERE’);

// wait for the button to exist

await page.waitForSelector(‘[class*=“phone”]’); // adjust selector as needed

// click it

await page.click(‘[class*=“phone”]’);

// wait a bit for the number to appear

await page.waitForTimeout(2000);

// grab the phone number (you’ll need to inspect the page to get the right selector)

const phone = await page.$eval(‘.phone-number-class’, el => el.innerText);

await browser.close();

return phone;

})();

```

you’ll need to inspect the page source to find the exact CSS selectors for the button and the phone number element though.

**option 2: if n8n puppeteer is limited, try the Code node with headless-chromium**

some people have had better luck with a plain Code node if your n8n instance allows it.

**option 3: check if theres an API**

mubawab might have an API endpoint that returns the phone number. open your browser devtools (F12), go to Network tab, click the show phone button, and see what request fires. sometimes theres a hidden API call that you can hit directly instead of clicking buttons.

lmk which approach gets closest and i can help debug the selectors or whatever else comes up