- Version
- Last Updated
- Prerequisites
- Initial Setup
- Setup and Usage Instructions
- Available Commands
- Best Practices
- Documentation
- Extending the Application
- External Resources
Current Version: 2.0.0
Date: 2026-06-09
- Operating System: Windows 7/8/10/11 or Windows Server 2008+
- Framework: .NET Framework 3.5 Service Pack 1 or higher
- Database: SQL Server 2008, 2012, 2014, 2016, 2019, or 2022 (Express editions supported)
- Web Server: IIS 7.0 or higher with ASP.NET enabled
- IDE: Visual Studio 2010 or higher (Visual Studio 2022 recommended)
- RAM: 2GB minimum (4GB recommended for Visual Studio)
- Disk Space: 100MB for application + database growth
- .NET Framework: Ensure .NET Framework 3.5 is enabled in Windows Features.
- SQL Server: Install SQL Server Express if you don't have a database server.
- IIS: Enable "Internet Information Services" and "ASP.NET" in Windows Features.
- Clone or download the repository to your local machine
- Open the project in Visual Studio
- Set up the SQL Server database (see Database Setup below)
- Update the connection string in
web.config - Build the LINQ-to-SQL mapping (see LINQ-to-SQL Setup below)
This application is designed to be hosted on IIS and accessed via a web browser. The primary interaction points are HTTP handlers (.ashx) and Web Forms (.aspx).
- Verify Database Connectivity: Ensure your SQL Server is running and the connection string in
web.configis correct. - Host on IIS: For best performance, host the project on a local IIS server rather than using the Visual Studio development server.
- Access the Application: Navigate to
http://localhost/cv-spider-v2/in your browser.
While this is a web application, you can use the following "commands" (actions) during development:
- Build Solution: Press
Ctrl + Shift + Bin Visual Studio to compile all components. - Run with Debugging: Press
F5to start the application with the debugger attached. - Run without Debugging: Press
Ctrl + F5for faster startup without the debugger. - Regenerate ORM: Right-click
CVIma2.dbmland select "Run Custom Tool" if the database schema changes.
The application uses HTTP Handlers as "scripts" that can be triggered manually or via scheduled tasks:
- Fetch Mails Script:
GET /FetchMails.ashx- Triggers the scraping and extraction process.
- Print Mails Script:
GET /PrintMails.ashx- Exports/displays the collected data.
- Legacy Interface:
GET /WallaSearch.aspx- Interactive search and validation page.
- Open SQL Server Management Studio
- Create a new database named
CVBilly3(or your preferred name) - Create the required tables:
-- CVMails table: stores extracted email addresses
CREATE TABLE CVMails (
asdws BIGINT PRIMARY KEY IDENTITY(1,1),
Mail NVARCHAR(255) UNIQUE NOT NULL,
Date DATETIME NOT NULL
);
-- LastIDs table: tracks the last used ID
CREATE TABLE LastIDs (
sdfsdgdf NVARCHAR(10) PRIMARY KEY,
LastID1 BIGINT NOT NULL
);
-- Initialize LastIDs
INSERT INTO LastIDs (sdfsdgdf, LastID1) VALUES ('1', 0);- Open
web.config - Update the connection string:
<connectionStrings> <add name="DB" connectionString="Data Source=YOUR_SERVER;Initial Catalog=CVBilly3;Integrated Security=True;" providerName="System.Data.SqlClient" /> </connectionStrings>
- Replace
YOUR_SERVERwith your SQL Server instance name
- In Visual Studio, open Server Explorer
- Add a connection to your database
- Right-click on
App_Codefolder → Add → New Item → LINQ-to-SQL Classes - Name it
CVIma2.dbml - Drag the tables (
CVMails,LastIDs) from Server Explorer onto the designer surface - Save the file (this generates
CVIma2.designer.cs)
The application randomly combines the following parameters to create search queries:
-
Cities (
App_Code/Cities.cs)- Contains a list of Israeli cities
- Add or remove cities as needed
-
Professions (
App_Code/Professions.cs)- Contains job titles in Hebrew
- Customize based on your target professions
-
Mail Types (
App_Code/MailTypes.cs)- Contains Hebrew and English variations of "email"
- Used to improve search accuracy
The application generates search queries in the format:
דרושים [PROFESSION] ב[CITY] [MAIL_TYPE]
Example: "דרושים מנהלת משרד בכפר סבא מייל"
- Open the project in Visual Studio
- Press F5 to run in debug mode
- The application will open in your default browser
- Access the web handlers:
/FetchMails.ashx- Main email fetching handler/WallaSearch.aspx- Search interface (legacy)/PrintMails.ashx- View collected emails
- Build the project in Release mode
- Publish to IIS:
- Right-click project → Publish
- Choose IIS, FTP, or File System
- Configure IIS Application Pool (.NET Framework 3.5)
- Set appropriate permissions for database access
Endpoint: /FetchMails.ashx
Parameters:
i(optional): Previous count to add to the result
Example:
http://localhost/cv-spider-v2/FetchMails.ashx?i=100
How it works:
- Generates random search query from cities, professions, and mail types
- Searches Walla search engine (pages 2-11)
- Extracts URLs from search results
- Visits each URL and extracts email addresses using regex
- Validates and cleans email addresses
- Stores unique emails in the database
- Returns the count of newly found emails
The application performs several validation steps:
- Checks for
@symbol - Rejects image file extensions (.jpg, .png)
- Validates minimum length for email parts
- Cleans common typos and malformed domains
The ClearEmail method fixes common issues:
- Removes special characters
- Corrects Israeli domain typos (.co → .co.il)
- Fixes common misspellings (.con → .com)
- Removes mailto: prefixes
- Normalizes domain extensions
cv-spider-v2/
├── App_Code/ # Server-side classes
│ ├── BLL.cs # Business Logic Layer
│ ├── DAL.cs # Data Access Layer
│ ├── DbUtilsDal.cs # Database utilities
│ ├── CVIma2.designer.cs # LINQ-to-SQL generated code
│ ├── Cities.cs # City list provider
│ ├── Professions.cs # Profession list provider
│ └── MailTypes.cs # Email keyword variations
├── FetchMails.ashx # Main email fetching handler
├── NewFetchMails.ashx # Alternative fetching handler
├── PrintMails.ashx # Email display handler
├── WallaSearch.aspx # Legacy search page
├── WallaSearch.aspx.cs # Legacy search code-behind
├── Default.aspx # Default landing page
├── web.config # Application configuration
├── jquery.min.js # jQuery library
└── jquery.timer.js # Timer utility
- Rate Limiting: Be mindful of search engine rate limits to avoid IP blocking
- Ethical Considerations: This tool is for educational purposes; ensure compliance with anti-spam laws
- Data Privacy: Handle collected email addresses responsibly and in compliance with GDPR/privacy laws
- Search Engines: The application uses Walla search; search engine APIs may change over time
- Database Growth: The
CVMailstable will grow over time; implement archiving if needed - Concurrent Access: The application uses locking for thread-safe database operations
- Thread Safety: Always use the
lock(typeof(DAL))or similar patterns when performing write operations to the database to prevent deadlocks and race conditions. - Regex Performance: Test regex patterns against large HTML samples to ensure they don't cause ReDoS (Regular Expression Denial of Service).
- Data Cleaning: Periodically review the
ClearEmailmethod to add new common typos found in the field. - Error Logging: Check the IIS logs or implement a custom logger in
App_Codeto track scraping failures. - SQL Indexing: Ensure the
Mailcolumn inCVMailsis indexed (it is by default as a UNIQUE constraint) for fast lookups.
- README.md: Overview of the project, architecture, and features.
- CONTRIBUTING.md: Guidelines for contributing to the project.
- Inline Comments: Refer to the C# code in
App_Code/for detailed implementation logic.
- Adding New Search Engines: Create a new method in
BLL.csto handle different search result HTML structures. - Custom Validation: Add new rules to the email validation logic to filter out more noise.
- Export Formats: Modify
PrintMails.ashxto support CSV or Excel export by changing theResponse.ContentType. - Scheduled Tasks: Use Windows Task Scheduler to call
FetchMails.ashxperiodically usingcurlorpowershell.
- .NET Framework 3.5 Documentation
- LINQ to SQL Overview
- SQL Server Express Download
- IIS Configuration Guide
-
Database Connection Errors
- Verify SQL Server is running
- Check connection string in
web.config - Ensure database user has proper permissions
-
LINQ-to-SQL Errors
- Regenerate the
.designer.csfile - Verify table names match the database schema
- Regenerate the
-
No Emails Found
- Check if search engine structure has changed
- Verify internet connection
- Check regex patterns in email extraction code
-
Duplicate Key Errors
- Ensure
Mailcolumn has UNIQUE constraint - Check for race conditions in concurrent operations
- Ensure
- Or Assayag - Initial work - orassayag
- Or Assayag orassayag@gmail.com
- GitHub: https://github.com/orassayag
- StackOverflow: https://stackoverflow.com/users/4442606/or-assayag?tab=profile
- LinkedIn: https://linkedin.com/in/orassayag