{"id":27083620,"url":"https://github.com/abhishekn1947/samgov-scraper","last_synced_at":"2026-04-09T07:05:55.035Z","repository":{"id":285685919,"uuid":"958983962","full_name":"Abhishekn1947/SamGov-Scraper","owner":"Abhishekn1947","description":"Automated Python scraper for sam.gov contracts","archived":false,"fork":false,"pushed_at":"2025-04-02T05:17:23.000Z","size":2580,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T06:22:14.413Z","etag":null,"topics":["analytics","automation","aws","data","pandas","postgresql","rds","selenium","webscraper"],"latest_commit_sha":null,"homepage":"https://sam.gov/search/?index=opp\u0026page=1\u0026pageSize=25\u0026sort=-modifiedDate\u0026sfm%5BsimpleSearch%5D%5BkeywordRadio%5D=ALL\u0026sfm%5Bstatus%5D%5Bis_active%5D=true","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Abhishekn1947.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-04-02T04:43:45.000Z","updated_at":"2025-04-02T05:17:26.000Z","dependencies_parsed_at":"2025-04-02T06:22:17.491Z","dependency_job_id":"3b77e590-a0a2-41e7-897e-3e4c9eee43d2","html_url":"https://github.com/Abhishekn1947/SamGov-Scraper","commit_stats":null,"previous_names":["abhishekn1947/samgov-scraper"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abhishekn1947%2FSamGov-Scraper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abhishekn1947%2FSamGov-Scraper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abhishekn1947%2FSamGov-Scraper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abhishekn1947%2FSamGov-Scraper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Abhishekn1947","download_url":"https://codeload.github.com/Abhishekn1947/SamGov-Scraper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247427012,"owners_count":20937214,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytics","automation","aws","data","pandas","postgresql","rds","selenium","webscraper"],"created_at":"2025-04-06T03:17:52.786Z","updated_at":"2025-12-30T23:06:34.144Z","avatar_url":"https://github.com/Abhishekn1947.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Automated Contract Scraping and Data Processing System\n\n## 🔍 Overview\n\nThis project automates the extraction of contract data from [SAM.gov](https://sam.gov/), processes it, and delivers the results through:\n- Email notifications via AWS SES\n- Storage in an AWS RDS PostgreSQL database\n- CSV file export\n\nThe system achieves up to **93% time savings** compared to manual collection methods and significantly reduces errors when collecting contract details such as:\n- Contract names\n- Notice IDs\n- Departments\n- Attachments\n- Key dates\n\n![diagram](https://github.com/user-attachments/assets/994b6ef2-e6e8-4ca7-a007-774c29b63121)\n\n### 📚 Documentation\n\n- **Detailed System Documentation**: See `Automated Contract Scraping and Data Processing System.pdf` in the project directory\n- **AI Insights Documentation**: `Deriving Insights from Scraped Contract Data Using AI.pdf` (Future work sample)\n\n\u003e **Note**: This script is specifically tailored for SAM.gov with site-specific selectors. To adapt it for other websites, you'll need to modify the code's selectors and logic.\n\n## 🛠️ Technologies Used\n\n- **Selenium**: Web scraping and browser automation\n- **Pandas**: Data manipulation and processing\n- **AWS SES**: Email notification delivery\n- **AWS RDS**: PostgreSQL database for persistent storage\n\n## 📋 Prerequisites\n\nBefore running this project, ensure you have:\n\n- **Python**: Version 3.6 or higher\n- **Firefox Browser**: Required for Selenium automation\n- **geckodriver**: [Download here](https://github.com/mozilla/geckodriver/releases) and place it in your system's PATH\n- **AWS Account**: With SES and RDS services configured\n- **Required Python Libraries**:\n  - selenium\n  - pandas\n  - boto3\n  - psycopg2-binary\n  - python-dotenv\n\n## 🚀 Getting Started\n\n### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/Abhishekn1947/RFP-Web-Scraper.git\ncd RFP-Web-Scraper\n```\n\n### 2. Install Dependencies\n\n```bash\npip install -r requirements.txt\n```\n\n### 3. Configure Environment Variables\n\nCreate a `.env` file in the project root:\n\n```bash\ntouch .env\n```\n\nAdd the following configuration to your `.env` file (replace placeholder values with your actual credentials):\n\n```\n# Path to the geckodriver executable\nGECKO_DRIVER_PATH=/path/to/geckodriver\n\n# URL to start scraping contracts (preconfigured for IT \u0026 Telecom contracts)\nTARGET_URL=https://sam.gov/search/?page=1\u0026pageSize=100\u0026sort=-modifiedDate\u0026index=opp\u0026sfm%5BsimpleSearch%5D%5BkeywordRadio%5D=ALL\u0026sfm%5Bstatus%5D%5Bis_active%5D=true\u0026sfm%5BserviceClassificationWrapper%5D%5Bpsc%5D%5B0%5D%5Bkey%5D=7\u0026sfm%5BserviceClassificationWrapper%5D%5Bpsc%5D%5B0%5D%5Bvalue%5D=7%20-%20IT%20AND%20TELECOM%20-%20INFORMATION%20TECHNOLOGY%20AND%20TELECOMMUNICATIONS\u0026sfm%5BtypeOfNotice%5D%5B0%5D%5Bkey%5D=p\u0026sfm%5BtypeOfNotice%5D%5B0%5D%5Bvalue%5D=Presolicitation\u0026sfm%5BtypeOfNotice%5D%5B1%5D%5Bkey%5D=o\u0026sfm%5BtypeOfNotice%5D%5B1%5D%5Bvalue%5D=Solicitation\n\n# Comma-separated list of NAICS codes to filter contracts\nNAICS_CODES=your-naics-codes\n\n# Directory paths\nFINAL_OUTPUT_DIRECTORY=/path/to/output\nLOGS=/path/to/logs\n\n# AWS SES configuration\nAWS_REGION=us-east-1\nAWS_ACCESS_KEY_ID=your-aws-access-key\nAWS_SECRET_ACCESS_KEY=your-aws-secret-key\nEMAIL_SENDER=your-email@example.com\nEMAIL_RECIPIENTS=recipient1@example.com,recipient2@example.com\n\n# AWS RDS PostgreSQL configuration\nRDS_HOST=your-rds-host\nRDS_DBNAME=your-db-name\nRDS_USERNAME=your-db-username\nRDS_PASSWORD=your-db-password\nRDS_PORT=5432\n```\n\n\u003e **Note**: For AWS security best practices, never commit the `.env` file to version control. Add it to your `.gitignore` file.\n\n### 4. Run the Scraper\n\n```bash\npython Main.py\n```\n\n## 🔄 Process Flow\n\nWhen executed, the script will:\n1. Scrape contract data from SAM.gov based on the URL in your configuration\n2. Filter contracts by the NAICS codes specified\n3. Process and clean the data\n4. Generate a CSV file in your specified output directory\n5. Store the data in your AWS RDS database\n6. Send the CSV file via email to your specified recipients\n\n## 📊 Sample Output\n\nFor an example of the extracted data format, refer to `Sample_data.csv` in the Final CSV folder of the repository.\n\n## ⚠️ Troubleshooting\n\n### Selenium Issues\n- Ensure geckodriver and Firefox are properly installed and in your PATH\n- For debugging, disable headless mode by commenting out `options.add_argument(\"--headless\")` in the `initialize_driver()` function to see browser actions\n\n### AWS SES Errors\n- Verify your AWS credentials are correct\n- Ensure your sender email is verified in AWS SES\n- Check AWS SES sending limits and region settings\n\n### RDS Connection Problems\n- Check that your RDS security group allows connections from your IP address\n- Verify your RDS credentials and database existence\n- Test connection using the `test_rds_connection()` utility function\n\n### Website Structure Changes\n- If SAM.gov updates its structure, the script may fail due to selector changes\n- Update the CSS selectors/XPaths in the code to match the new structure\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## 📝 License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhishekn1947%2Fsamgov-scraper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabhishekn1947%2Fsamgov-scraper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhishekn1947%2Fsamgov-scraper/lists"}