Work sample 15 / 15Websites & scripts

Lead list built from public directories into a checked Excel file

How I collect business listings from public directories, politely and reliably, into a de-duplicated Excel list ready for a CRM.

Area
Websites & scripts
Tools
Python · Excel
Typical scope
US$1,000–2,000
Timeline
About 2 weeks · 4 fixed milestones

Work sample: realistic data, built to show how I approach this kind of project. Not a past client job.

01The problem

Building a lead list by copy and paste from directories takes days and the result is full of duplicates and gaps. A script can do it in minutes, but only if it respects the site, handles layout changes and retries errors.

The deliverable is a clean, checked list with a log of every request.

Owners usually notice it as

  1. Lists built by copy and paste
  2. Duplicates across categories
  3. Missing phones or websites
  4. No record of where each row came from

02Scope

A fixed scope agreed in writing before anything is built. The table shows what a project like this usually covers and what it leaves out.

Exhibit 1Scope: what a project like this covers
AreaIncluded
SourcesAgreed public directories and categories
Collectionrobots.txt respected, pagination followed, two layouts handled
ReliabilityRetries and a request log
Clean-upDe-duplicated, phones standardised, categories mapped
OutputExcel and CSV ready for CRM import
Not includedSites that forbid collection, and personal data
Exhibit 2Typical data volumes for this kind of project (log scale)
Listings collected8,000
Requests9,500
Categories20
Regions10
Checks8

Typical volumes for a business of this size. The sample files are sized as described in section 05.

Exhibit 3Fixed milestones, each released when you sign off its deliverable
MilestoneDeliverableTimingShareWeeks 1–2
M1 ScopeSources, fields and rules agreedWeek 125%
M2 ScriptCollection script and logWeek 135%
M3 CleanDe-duplicated, checked listWeek 225%
M4 HandoverFiles, script, guideWeek 215%

Typical scope for this kind of project: US$1,000–2,000

About 2 weeks across 4 fixed milestones. The fixed quote follows a US$300 Systems Health Check, which confirms the volumes and the scope first. Your software subscriptions are billed to you by the vendors.

03How I approach it

Exhibit 4How the work flows, from the first record to sign-off
φ = 1.61801ROBOTSrules02FETCHpages03PARSE2 layouts04RETRYlog05CLEANde-dup06EXCELlist6 STAGES · ONE PASS FROM FIRST RECORD TO SIGN-OFFi. check the rulesii. handle layout changesiii. log the source01ROBOTSrules02FETCHpages03PARSE2 layouts04RETRYlog05CLEANde-dup06EXCELlist

Construction drawing. Each stage has its own check before the next one starts.

  1. 01

    Check the rules

    robots.txt and terms first.

  2. 02

    Collect gently

    Rate-limited requests with retries.

  3. 03

    Handle layout changes

    Parsers for each layout, with a test page for each.

  4. 04

    Clean and de-duplicate

    Same business across categories becomes one row.

  5. 05

    Log the source

    Every row keeps its source URL.

04Checks

Nothing goes live on trust. These checks run before sign-off and stay in the files, so they can be re-run after every change.

  1. Every listing has a source URL
  2. No duplicate businesses
  3. Failed requests retried and logged
  4. Phones in a standard format
  5. Row count matches the log
Exhibit 5Controls in the sample files: 8 of 8 pass
CheckWhat it catchesStatus
Duplicate listing IDsListed on the Checks tabPASS
Phones not in +61 format (10 digits)Listed on the Checks tabPASS
Listings without a nameListed on the Checks tabPASS
Ratings outside 1-5Listed on the Checks tabPASS
Emails without @Listed on the Checks tabPASS
Listing pages that failed after retriesListed on the Checks tabPASS
Requests to robots.txt-disallowed pathsListed on the Checks tabPASS
Unique listings vs category entries minus cross-listingsListed on the Checks tabPASS

Status read from the sample workbook. Each check is a formula, not a typed value.

05Handover

Everything is handed over in editable files you own, with the steps written down so your team is not dependent on me.

In this work sample

A Python collection script run against a test directory: 158 listings from 182 requests, with 8 checks.

  1. Excel and CSV list
  2. Script with comments
  3. Request log
  4. Guide to re-running it

06Files in this work sample

Screens from the sample files. Select one to open it full size.

Listings tab: scraped business name, category, street, town, phone in +61 format, email, website and rating
Exhibit 6Listings tab: scraped business name, category, street, town, phone in +61 format, email, website and rating

Directory-Listings.xlsx › Listings

Checks tab comparing the scraped results with the expected counts
Exhibit 7Checks tab comparing the scraped results with the expected counts

Directory-Listings.xlsx › Checks

Summary tab: listings per category with email, website and rating coverage
Exhibit 8Summary tab: listings per category with email, website and rating coverage

Directory-Listings.xlsx › Summary

FilesDownload the work sample
FileWhat it isSize
scrape_directory.pyThe scraper: robots.txt, crawl delay, pagination, two page templates, retries, de-duplication6.6 KB
Directory-Listings.xlsxOutput workbook: listings, summary, checks and request log28 KB
directory_listings.csvOutput CSV30.4 KB
scrape_log.csvEvery request with status and timing5.4 KB

Tell me what’s bugging you and I’ll tell you where I’d look first.

Send a short note on Upwork about what is slowing the business down. I’ll reply with where I’d start, and whether the US$300 Systems Health Check is the right first step.