Automated website visitor with scheduling and advanced browser automation
Project description
Auto Website Visitor
A powerful Python package for automated website visiting with advanced browser automation, scheduling capabilities, and comprehensive configuration options.
[!CAUTION] This package is designed for legitimate testing and automation purposes. Ensure compliance with website terms of service and applicable laws.
[!NOTE] This package is under active development. Features and APIs may change in future releases.
Features
- Multi-browser Support: Chrome, Firefox, and Edge
- Flexible Scheduling: Interval-based and cron-based scheduling
- Advanced Browser Options: Headless mode, custom user agents, proxy support
- Auto-Scrolling: Simulate natural browsing behavior
- Retry Logic: Configurable retry attempts with delays
- Comprehensive Logging: Rotating logs with configurable levels
- CLI Interface: Interactive menu and command-line options
- Configuration Files: JSON and YAML support
- Auto-Updates: Built-in update mechanism
- Environment Variables: Support for sensitive configuration
Installation
pip install auto-website-visitor
Quick Start
Basic Usage
# Visit a website 5 times
awv --url https://example.com --count 5
# Use Firefox in headless mode with auto-scroll
awv --url https://example.com --count 10 --browser firefox --headless --auto-scroll
# Use proxy server
awv --url https://example.com --count 5 --proxy 127.0.0.1:8080
Interactive Mode
awv --interactive
Using Configuration Files
Create a sample configuration file:
awv create-config --config-path config.yaml
Example configuration (config.yaml):
url: https://example.com
visit_count: 5
interval: 10
browser: chrome
headless: true
auto_scroll: true
scroll_pause: 1.0
max_scroll: 3
random_delay: true
delay_range: [2, 8]
proxy: 127.0.0.1:8080
retry_attempts: 3
retry_delay: 5
log_level: INFO
log_file: visitor.log
Run with configuration:
awv --config config.yaml
Scheduled Execution
Interval-based Scheduling
# Run every hour
awv --url https://example.com --schedule "1h" --headless
# Run every 30 minutes
awv --url https://example.com --schedule "30m" --headless
# Run every 45 seconds
awv --url https://example.com --schedule "45s" --headless
Cron-based Scheduling
# Run every 30 minutes
awv --url https://example.com --schedule "*/30 * * * *" --headless
# Run weekdays at 9 AM
awv --url https://example.com --schedule "0 9 * * 1-5" --headless
# Run every hour during business hours
awv --url https://example.com --schedule "0 9-17 * * 1-5" --headless
Configuration Options
Core Settings
url: Target website URL (required)visit_count: Number of visits to perform (default: 1)interval: Seconds between visits (default: 5)timeout: Page load timeout in seconds (default: 30)
Browser Options
browser: Browser to use - chrome, firefox, or edge (default: chrome)headless: Run browser in headless mode (default: false)user_agent: Custom user agent stringproxy: Proxy server (format: "ip:port" or "user:pass@ip:port")
Behavior Settings
auto_scroll: Enable automatic page scrolling (default: false)scroll_pause: Pause between scroll actions in seconds (default: 0.5)max_scroll: Maximum number of scroll actions (default: 5)random_delay: Enable random delays between actions (default: false)delay_range: Range for random delays in seconds (default: [1, 5])
Scheduler Settings
schedule_enabled: Enable scheduled execution (default: false)schedule_type: Schedule type - interval or cron (default: interval)schedule_value: Schedule value (e.g., "1h", "*/30 * * * *")
Advanced Options
retry_attempts: Number of retry attempts on failure (default: 3)retry_delay: Delay between retry attempts in seconds (default: 5)log_level: Logging level - DEBUG, INFO, WARNING, ERROR (default: INFO)log_file: Log file path (default: auto_visitor.log)log_rotate: Enable log rotation (default: true)max_log_size: Maximum log file size (default: 1MB)backup_count: Number of backup log files (default: 3)
Environment Variables
Set sensitive configuration via environment variables:
export PROXY_USER="username"
export PROXY_PASS="password"
export CUSTOM_HEADERS='{"Authorization": "Bearer token123"}'
CLI Commands
Main Command
awv [OPTIONS]
Available Options
--url, -u: Target website URL--count, -c: Number of visits--interval, -i: Seconds between visits--browser, -b: Browser choice (chrome/firefox/edge)--headless: Run in headless mode--user-agent: Custom user agent--proxy: Proxy server--auto-scroll: Enable auto-scrolling--random-delay: Enable random delays--config: Configuration file path--schedule: Schedule expression--interactive: Interactive mode--log-level: Logging level--version: Show version
Subcommands
# Create sample configuration file
awv create-config --config-path config.yaml
# Check for updates
awv update
Python API
Use Auto Website Visitor programmatically:
from auto_website_visitor import AutoWebsiteVisitor, VisitorSettings
# Create settings
settings = VisitorSettings(
url="https://example.com",
visit_count=5,
browser="chrome",
headless=True,
auto_scroll=True
)
# Run visitor
visitor = AutoWebsiteVisitor(settings)
success = visitor.run()
# Get statistics
stats = visitor.get_stats()
print(f"Success rate: {stats['success_rate']:.1f}%")
Scheduled Execution
from auto_website_visitor import AutoWebsiteVisitor, VisitorSettings, SchedulerManager
from auto_website_visitor.logger import VisitorLogger
settings = VisitorSettings(url="https://example.com", headless=True)
logger = VisitorLogger(settings)
scheduler = SchedulerManager(logger)
def scheduled_job():
visitor = AutoWebsiteVisitor(settings)
visitor.run()
# Schedule every 30 minutes
scheduler.schedule_job(scheduled_job, "interval", "30m")
scheduler.wait_for_completion()
Logging
Auto Website Visitor provides comprehensive logging:
- Console Output: Real-time status updates
- File Logging: Detailed logs with rotation
- Configurable Levels: DEBUG, INFO, WARNING, ERROR
- Structured Format: Timestamps and categorized messages
Example log output:
2024-01-15 10:30:00 - auto_website_visitor - INFO - Starting Auto Website Visitor
2024-01-15 10:30:00 - auto_website_visitor - INFO - Target URL: https://example.com
2024-01-15 10:30:00 - auto_website_visitor - INFO - Visit count: 5
2024-01-15 10:30:01 - auto_website_visitor - INFO - Starting visit 1/5
2024-01-15 10:30:02 - auto_website_visitor - INFO - Visiting: https://example.com
2024-01-15 10:30:05 - auto_website_visitor - INFO - Website visit completed successfully
Error Handling
The package includes robust error handling:
- Retry Logic: Automatic retries on failures
- Timeout Management: Configurable page load timeouts
- Browser Recovery: Automatic browser restart on crashes
- Graceful Degradation: Continues operation despite individual failures
Security Considerations
- Proxy Support: Route traffic through proxy servers
- User Agent Rotation: Avoid detection with custom user agents
- Rate Limiting: Control visit frequency to avoid overwhelming servers
- Headless Mode: Run without visible browser windows
Performance Tips
- Use Headless Mode: Significantly faster execution
- Optimize Intervals: Balance speed with server courtesy
- Configure Timeouts: Avoid hanging on slow pages
- Monitor Resources: Use appropriate retry settings
- Log Management: Enable rotation for long-running tasks
Troubleshooting
Common Issues
-
WebDriver Not Found
# The package automatically downloads drivers, but you can install manually: pip install webdriver-manager --upgrade
-
Permission Denied
# On Linux/Mac, you might need to set executable permissions: chmod +x /path/to/chromedriver
-
Proxy Authentication
# Use environment variables for credentials: export PROXY_USER="username" export PROXY_PASS="password"
-
Memory Issues
- Enable headless mode
- Reduce visit count
- Increase intervals between visits
Debug Mode
Enable debug logging for troubleshooting:
awv --url https://example.com --log-level DEBUG
Updates
Check for and install updates:
# Check for updates
awv update
# Or use pip directly
pip install --upgrade auto-website-visitor
Contributing
Contributions are welcome! Please feel free to submit pull requests, report bugs, or suggest new features.
License
This project is licensed under the MIT License - see the LICENSE file for details.
[!CAUTION] This tool is intended for legitimate testing and automation purposes only. Users are responsible for complying with website terms of service and applicable laws. Always respect robots.txt files and rate limiting guidelines.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file auto_website_visitor-3.0.0.tar.gz.
File metadata
- Download URL: auto_website_visitor-3.0.0.tar.gz
- Upload date:
- Size: 24.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
077f56dce6cbe7a4e424ba538a4ecb86890145879aa516ace8dddb49d1dc8543
|
|
| MD5 |
ad706508a76e7d0d3caf1cba8cf99875
|
|
| BLAKE2b-256 |
e29d51750ede4d6750264f91a82a92787378df6c570089ee5fa170280844e142
|
Provenance
The following attestation bundles were made for auto_website_visitor-3.0.0.tar.gz:
Publisher:
buildpypi.yml on nayandas69/auto-website-visitor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
auto_website_visitor-3.0.0.tar.gz -
Subject digest:
077f56dce6cbe7a4e424ba538a4ecb86890145879aa516ace8dddb49d1dc8543 - Sigstore transparency entry: 278195906
- Sigstore integration time:
-
Permalink:
nayandas69/auto-website-visitor@5f5b03b14b72717d97e8e26de518c2c0adf4f5b0 -
Branch / Tag:
refs/tags/3.0.0 - Owner: https://github.com/nayandas69
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
buildpypi.yml@5f5b03b14b72717d97e8e26de518c2c0adf4f5b0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file auto_website_visitor-3.0.0-py3-none-any.whl.
File metadata
- Download URL: auto_website_visitor-3.0.0-py3-none-any.whl
- Upload date:
- Size: 23.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a084051a6c1ccb51472eaa4f801e44b74332b33bf70e2a7f7d4bdc8a15ac58a
|
|
| MD5 |
65228f15bfb1db73a4de8831d083df29
|
|
| BLAKE2b-256 |
8857b1afc65e91e4d0dd038c2ca6127d23bdc2aea727d0e3058133f9dcc24b7f
|
Provenance
The following attestation bundles were made for auto_website_visitor-3.0.0-py3-none-any.whl:
Publisher:
buildpypi.yml on nayandas69/auto-website-visitor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
auto_website_visitor-3.0.0-py3-none-any.whl -
Subject digest:
7a084051a6c1ccb51472eaa4f801e44b74332b33bf70e2a7f7d4bdc8a15ac58a - Sigstore transparency entry: 278195917
- Sigstore integration time:
-
Permalink:
nayandas69/auto-website-visitor@5f5b03b14b72717d97e8e26de518c2c0adf4f5b0 -
Branch / Tag:
refs/tags/3.0.0 - Owner: https://github.com/nayandas69
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
buildpypi.yml@5f5b03b14b72717d97e8e26de518c2c0adf4f5b0 -
Trigger Event:
push
-
Statement type: