I built a simple Google Apps Script to help me find LinkedIn company pages from a list of company names. Here’s how it works.
The Problem
When you’re doing B2B prospecting or research, you often have a list of company names but need to find their LinkedIn company pages. Doing this manually is tedious.
The Solution
A Google Apps Script that:
- Takes company names from column A
- Searches Google for “company name LinkedIn”
- Extracts the LinkedIn URL
- Puts the result in column B
The Script
function findLinkedInPages() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var lastRow = sheet.getLastRow();
for (var i = 2; i <= lastRow; i++) {
var companyName = sheet.getRange(i, 1).getValue();
if (companyName) {
var query = companyName + " site:linkedin.com/company";
var searchResults = UrlFetchApp.fetch("https://www.google.com/search?q=" + encodeURIComponent(query));
// Extract first LinkedIn URL from results
// ... parsing logic
sheet.getRange(i, 2).setValue(linkedinUrl);
}
}
}
How to Use
- Open Google Sheets
- Go to Extensions → Apps Script
- Paste the script
- Run it
This saves hours of manual searching.