tool_web_login
Automates website login by filling credentials and handling CAPTCHA detection. Supports form, OAuth, and API authentication with special handling for Naver login.
Instructions
Perform website login
This tool attempts to log in to the provided URL. It waits for automatic
input prevention (CAPTCHA) to be detected before allowing the user to manually resolve it.
Args:
url (str): Login page URL
credentials (Dict[str, str]): Login credentials
- username: User ID
- password: Password
selectors (Dict[str, str]): CSS selectors for login form elements
- username: ID input field selector
- password: Password input field selector
- submit: Login button selector
auth_type (str, optional): Authentication type. Defaults to "form"
- form: Regular form-based login
- oauth: OAuth authentication
- api: API-based authentication
wait_for (Optional[str], optional): CSS selector for element to wait for after login
Returns:
Dict[str, Any]: Login result
- success (bool): Login success status
- message (str): Status message
- session_data (Dict): Login success session information
- cookies: Cookie information
- localStorage: Local storage data
- sessionStorage: Session storage data
Special handling:
1. CAPTCHA detection
- If reCAPTCHA or standard CAPTCHA is detected, wait for user to manually resolve
- Automatically continue login process after resolution
2. Naver login
- Automatic detection of various special situations like automatic input prevention, 2-step authentication
- Detailed error message analysis and return
Example:
>>> result = tool_web_login(
... url="https://nid.naver.com/nidlogin.login",
... credentials={
... "username": "your_username",
... "password": "your_password"
... },
... selectors={
... "username": "#id",
... "password": "#pw",
... "submit": ".btn_login"
... }
... )
>>> if not result["success"] and "CAPTCHA" in result["message"]:
... # Wait for user input for CAPTCHA resolution
... print("Please solve the CAPTCHA in the browser")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | ||
| credentials | Yes | ||
| selectors | Yes | ||
| auth_type | No | form | |
| wait_for | No |