Skip to content

Automate Bing searches in Microsoft Edge using Python and Playwright. This tool loads queries from a file, simulates human-like behavior, and manages Edge profiles for seamless automation. Ideal for cross-platform use with detailed logging and error handling. Requires Python 3.13.4+ and Edge browser.

License

Notifications You must be signed in to change notification settings

Asdmir786/Automatic-Edge-Browser-Web-Searcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

67 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” Automatic Edge Browser Web Searcher (Python)

πŸ“‹ Overview

This Python application automates Microsoft Edge browser searches using Playwright. It loads search queries from a text file, removes duplicates, and performs random Bing searches with human-like behavior simulation.

✨ Key Features

  • 🌐 Cross-platform support (Windows, macOS, Linux)
  • πŸ” Automated Edge browser control via Playwright
  • πŸ‘€ Real Edge profile integration with automatic copying
  • 🎲 Random query selection without repetition
  • πŸ€– Human-like typing simulation with random delays
  • πŸ“Š Progress tracking with colored console output
  • πŸ›‘οΈ Comprehensive error handling and retry logic
  • πŸ“ Detailed logging for debugging
  • βš™οΈ Modern Python 3.13.4+ features

πŸš€ Quick Start

To get started quickly, follow these steps:

  1. Install Python 3.13+ (if you don't already have it). Ensure python is on your PATH.

  2. Download or clone this repository.

  3. Open Command Prompt as Administrator (on Windows) or elevated terminal (Linux/macOS) inside the project folder.

  4. Run the automated setup script:

    python setup.py

    The script WILL: β€’ create a dedicated virtual environment (.venv) β€’ install every required Python package β€’ download Playwright's Edge browser build β€’ verify administrator privileges

  5. When it finishes, activate the virtual environment as instructed on-screen, then start the program:

    python main.py

That's it β€” the setup script downloads the browser build and installs every dependency for you, so no additional manual steps are needed.

πŸ“ Project Structure

Automatic-Edge-Browser-Web-Searcher/
└── src/
    β”œβ”€β”€ main.py              # Main application script
    β”œβ”€β”€ process_killer.py    # Utility to kill processes locking files
    β”œβ”€β”€ requirements.txt     # Python dependencies
    β”œβ”€β”€ setup.py             # Automated setup script
    β”œβ”€β”€ queries.txt          # Search queries (1000+ included)
    └── README.md            # Documentation file

πŸ”§ Configuration

Search Queries

Edit queries.txt to customize search queries:

  • One query per line
  • Comments start with #
  • Duplicates are automatically removed

Edge Profiles

The application automatically:

  1. Detects available Edge profiles
  2. Lists them for user selection
  3. Creates temporary copies to avoid conflicts
  4. Uses persistent browser context

Handling Locked Files

If you encounter file locking issues (WinError 32) during profile copying, use these Command Prompt commands:

taskkill /f /im msedge.exe

Alternatively, you can kill specific Edge processes:

tasklist | findstr msedge
taskkill /f /pid [PID_NUMBER]

These commands will:

  1. Terminate all Microsoft Edge processes that may be locking files
  2. Free up locked profile files for copying
  3. Require Command Prompt to be run as Administrator
  4. Allow the automation script to proceed without file conflicts

πŸ–₯️ Platform Support

Platform Edge Profile Location Status
Windows %LOCALAPPDATA%\Microsoft\Edge\User Data βœ… Fully Supported
macOS ~/Library/Application Support/Microsoft Edge βœ… Supported
Linux ~/.config/microsoft-edge βœ… Supported

πŸ” How It Works

  1. System Detection: Identifies OS and Edge installation
  2. Profile Discovery: Finds available Edge user profiles
  3. Query Loading: Reads and deduplicates search queries
  4. Profile Selection: User chooses which profile to use
  5. Safe Copying: Creates temporary profile copy
  6. Browser Launch: Starts Edge with Playwright automation
  7. Search Execution: Performs random searches with human-like delays
  8. Progress Tracking: Shows real-time progress and results

πŸ› οΈ Advanced Usage

Custom Browser Arguments

Modify the args list in main.py to customize browser behavior:

args=[
    "--no-sandbox",
    "--disable-features=ImprovedCookieControls",
    "--disable-sync",
    # Add your custom arguments here
]

Logging Configuration

Logs are automatically saved to:

  • log_debug.txt (development mode)
  • log_release.txt (production mode)

Error Handling

The application includes robust error handling for:

  • Network connectivity issues
  • Browser launch failures
  • Profile access problems
  • Search execution errors

πŸ”’ Security & Privacy

  • Profile Isolation: Uses temporary profile copies
  • No Data Collection: All searches are performed locally
  • Safe Automation: Respects browser security features
  • Clean Cleanup: Temporary files are managed automatically

πŸ› Troubleshooting

Common Issues

"Playwright not installed"

pip install playwright
playwright install

"No Edge profiles found"

  • Ensure Microsoft Edge is installed and has been run at least once
  • Check if Edge profiles exist in the expected location

"Browser launch failed"

  • Try running with administrator privileges
  • Ensure Edge browser is not running
  • Check antivirus software isn't blocking automation

"Permission denied"

  • Close all Edge browser windows
  • Run terminal/command prompt as administrator
  • Check file permissions in the project directory

Debug Mode

Run with Python's debug flag for verbose output:

python -O main.py  # Optimized mode
python main.py     # Debug mode (default)

πŸ“Š Performance

  • Startup Time: ~2-5 seconds
  • Search Speed: ~3-5 seconds per query
  • Memory Usage: ~50-100MB
  • CPU Usage: Low during searches

πŸ”„ Migration from C# Version

This Python version maintains all core features from the original C# implementation:

βœ… Retained Features

  • Edge profile management
  • Query deduplication
  • Human-like search simulation
  • Progress tracking
  • Error handling and retries
  • Logging system

πŸ†• New Features

  • Cross-platform compatibility
  • Modern Python async/await patterns
  • Enhanced error messages
  • Improved profile copying
  • Better OS detection

πŸ”„ Changes

  • Removed Windows 10 restriction
  • Simplified browser installation
  • Enhanced cross-platform support
  • Modern Python 3.13.4+ features

πŸ“ License

This project is licensed under the terms specified in the LICENSE file.

🀝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

πŸ“ž Support

For issues and questions:

  1. Check the troubleshooting section
  2. Review the log files
  3. Create an issue with detailed information

Made with ❀️ using Python 3.13.4+ and Playwright

About

Automate Bing searches in Microsoft Edge using Python and Playwright. This tool loads queries from a file, simulates human-like behavior, and manages Edge profiles for seamless automation. Ideal for cross-platform use with detailed logging and error handling. Requires Python 3.13.4+ and Edge browser.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published