Bulk Data Scraping Using Google Sheets (Complete Method 2026)


Step 1: Create a New Google Sheet

  1. Open Google Sheets.

  2. Click on Blank Spreadsheet.

  3. In the first row, create the following column headers:

A1: URL  
B1: Emails  
C1: Phones  
D1: Status



Step 2: Open Apps Script

  1. From the top menu, click on Extensions.

  2. Click on Apps Script.

👉 (Add screenshot of Extensions → Apps Script here)

A new tab will open with the Google Apps Script Editor.




Step 3: Paste the Scraping Code

  1. In the Apps Script editor, remove any default code.

  2. Paste the following code:


function extractWebsiteDataBatch() {
  const sheet = SpreadsheetApp.getActiveSheet();
  const lastRow = sheet.getLastRow();

  let startRow = PropertiesService.getScriptProperties().getProperty("startRow");
  startRow = startRow ? parseInt(startRow) : 2;

  const batchSize = 500;  // PROCESS 500 URLs PER RUN
  const endRow = Math.min(startRow + batchSize - 1, lastRow);

  for (let i = startRow; i <= endRow; i++) {
    let url = sheet.getRange(i, 1).getValue();
    if (!url) continue;

    try {
      let response = UrlFetchApp.fetch(url, {
        muteHttpExceptions: true,
        followRedirects: true
      });

      let content = response.getContentText();

      // Extract emails
      let emails = content.match(/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}/g);
      emails = emails ? [...new Set(emails)] : [];

      // Extract ONLY phone numbers starting with +
      let phones = content.match(/\+\d[\d\s\-()]{6,20}/g);
      phones = phones ? [...new Set(phones.map(p => p.replace(/[^\d+]/g, "")))] : [];

      sheet.getRange(i, 2).setValue(emails.join(", "));
      sheet.getRange(i, 3).setValue(phones.join(", "));

    } catch (err) {
      sheet.getRange(i, 2).setValue("Error");
      sheet.getRange(i, 3).setValue("Error");
    }
  }

  // Save next range
  if (endRow < lastRow) {
    PropertiesService.getScriptProperties().setProperty("startRow", endRow + 1);

    // Auto-run next batch after 5 seconds
    ScriptApp.newTrigger("extractWebsiteDataBatch")
      .timeBased()
      .after(5000)
      .create();

  } else {
    PropertiesService.getScriptProperties().deleteProperty("startRow");
    SpreadsheetApp.getUi().alert("All scraping completed!");
  }
}



Step 4: Save the Project

  1. Click on Save Project.

  2. Give your project a name (example: Bulk Data Scraper).

  3. Click Save.




Step 5: Run the Script (First Time Authorization)

  1. Click the Run button.

  2. Google will ask for Authorization.

  3. Select your Gmail account.

  4. Click Advanced → Go to Project (if warning appears).

  5. Click Allow.







After permission is granted, the script becomes active.


Step 6: Add Bulk URLs in the Sheet

  1. Go back to your Google Sheet.

  2. Add your website URLs in Column A (URL) starting from Row 2.

  3. You can paste bulk URLs (hundreds or thousands).



Step 7: Run the Scraper

  1. Click again on Extensions.

  2. Open Apps Script.

  3. Click Run.

The script will now:

  • Visit each website

  • Extract emails

  • Extract phone numbers (only starting with +)

  • Fill data in:

    • Column B → Emails

    • Column C → Phones

It processes 500 URLs per run automatically and continues in batches every 5 seconds until all URLs are completed.



Final Result

  • Emails will appear in Column B

  • Phone numbers in Column C

  • When all URLs are processed, you will see a popup message:

    "All scraping completed!"


Note:

If you want lifetime free access to the Bulk Email Sender and Advanced Email & Number Extractor, contact us on WhatsApp at this number.

WhatsApp: +923226076102

Post a Comment

1 Comments