A fast and efficient JavaScript-based web scraping tool for extracting transportation company leads in Texas, including comprehensive contact information.
- Multi-Source Scraping: Yellow Pages, business directories, and company websites
- Contact Extraction: Automatically extracts emails, phone numbers, and owner/executive information
- Website Enrichment: Visits company websites to find additional contact details
- CSV Export: Outputs clean, formatted CSV files ready for use
- Mock Data Generation: Fast testing mode with realistic sample data
- Deduplication: Removes duplicate entries automatically
# Install dependencies
npm installnpm run exampleThis generates 200 mock transportation companies instantly for testing.
npm run scrapeimport { scrapeTransportationCompanies } from './scraper.js';
const results = await scrapeTransportationCompanies({
location: 'Texas',
targetCount: 200,
useMockData: true
});const results = await scrapeTransportationCompanies({
location: 'Texas',
searchTerms: ['transportation', 'trucking', 'freight', 'logistics'],
targetCount: 200,
useMockData: false,
enrichWebsites: true // Extract emails from company websites
});The scraper generates CSV files with the following columns:
| Column | Description |
|---|---|
| Business Name | Company name |
| Primary business email | |
| Phone | Primary business phone |
| Contact Name | Owner/Executive name |
| Contact Title | Job title (Owner, CEO, President, etc.) |
| Contact Email | Direct contact email |
| Contact Phone | Direct contact phone |
| Address | Street address |
| City | City name |
| State | State (TX) |
| Website | Company website URL |
| Source | Data source |
| Option | Type | Default | Description |
|---|---|---|---|
location |
string | 'Texas' | State to search |
searchTerms |
array | ['transportation', 'trucking', 'freight', 'logistics'] | Keywords to search |
targetCount |
number | 200 | Number of companies to extract |
useMockData |
boolean | true | Use generated data for testing |
enrichWebsites |
boolean | false | Visit websites to extract contact info |
scraping-tool/
├── scrapers/
│ ├── yellowPagesScraper.js # Yellow Pages scraper
│ ├── businessDirectoryScraper.js # Business directory scraper
│ ├── websiteScraper.js # Website enrichment
│ └── mockDataGenerator.js # Test data generator
├── utils/
│ ├── extractors.js # Email/phone extraction
│ └── csvWriter.js # CSV export
├── scraper.js # Main scraper
├── example.js # Example usage
└── output/ # Generated CSV files
- Mock Data Mode: Generates 200 companies in < 1 second
- Basic Scraping: 200 companies in ~10-15 minutes
- With Website Enrichment: 200 companies in ~30-60 minutes
- Rate Limiting: The tool includes delays to respect website rate limits
- Legal Compliance: Ensure compliance with website terms of service and data protection laws
- Data Accuracy: Real scraping depends on source website structure (may change)
- Mock Mode: Default mode uses generated data - set
useMockData: falsefor real scraping
Solution: Make sure to run npm install first
Solution: On Windows, you may need to install Chrome/Chromium
Solution: Website structures change - check scraper selectors may need updating
Check the output/ directory for generated CSV files. Each run creates a timestamped file.
Example: texas_transportation_companies_2025-10-10.csv
MIT
For issues or questions, please review the code comments and examples provided.