

# AgentCore 브라우저 시작하기
<a name="browser-quickstart"></a>

AgentCore 브라우저를 사용하면 에이전트가 관리형 Chrome 브라우저를 통해 웹 페이지와 상호 작용할 수 있습니다. 이 가이드에서는 5분 이내에 웹 사이트를 탐색하고 정보를 추출하는 AI 에이전트를 생성합니다.

**Topics**
+ [사전 조건](#browser-prerequisites)
+ [1단계: 종속성 설치](#browser-strands-install)
+ [2단계: 에이전트 생성](#browser-strands-create)
+ [3단계: 에이전트 실행](#browser-strands-run)
+ [4단계: 브라우저 세션 라이브 보기](#browser-strands-live-view)
+ [리소스 찾기](#browser-find-resources)
+ [다음 단계](#browser-next-steps)
+ [Nova 법과 함께 AgentCore 브라우저 사용](browser-quickstart-nova-act.md)
+ [Playwright에서 AgentCore 브라우저 사용](browser-quickstart-playwright.md)

## 사전 조건
<a name="browser-prerequisites"></a>

시작하기 전에 다음을 갖추어야 합니다.
+ Python 3.10 이상( [python.org/downloads](https://www.python.org/downloads/) )
+ Boto3 설치됨( [Boto3 설명서](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/quickstart.html) )
+  AWS 구성된 자격 증명 - 다음을 사용하여 확인합니다.

  ```
  aws sts get-caller-identity
  ```

  이 명령이 실패하면 AWS CLI 설명서의 [구성 및 자격 증명 파일 설정을](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) 참조하세요.
+ Amazon Bedrock 콘솔에서 Anthropic Claude Sonnet 4.0 모델 액세스 [활성화](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access-modify.html) 
+  AWS Amazon Bedrock AgentCore를 사용할 수 있는 리전([지원되는 AWS 리전](agentcore-regions.md) 참조)

 **IAM 권한** 

이 정책을 IAM 자격 증명에 연결합니다. IAM 콘솔에서 사용자 또는 역할을 찾고 **권한 추가** > **인라인 정책 생성을** 선택하고 JSON 보기로 전환한 후 붙여넣습니다.

```
{
"Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "BedrockAgentCoreBrowserFullAccess",
            "Effect": "Allow",
            "Action": [
                "bedrock-agentcore:CreateBrowser",
                "bedrock-agentcore:ListBrowsers",
                "bedrock-agentcore:GetBrowser",
                "bedrock-agentcore:DeleteBrowser",
                "bedrock-agentcore:StartBrowserSession",
                "bedrock-agentcore:ListBrowserSessions",
                "bedrock-agentcore:GetBrowserSession",
                "bedrock-agentcore:StopBrowserSession",
                "bedrock-agentcore:UpdateBrowserStream",
                "bedrock-agentcore:ConnectBrowserAutomationStream",
                "bedrock-agentcore:ConnectBrowserLiveViewStream"
            ],
            "Resource": "arn:aws:bedrock-agentcore:<Region>:++<account_id>++:browser/*"
        },
        {
            "Sid": "BedrockModelAccess",
            "Effect": "Allow",
            "Action": [
                "bedrock:InvokeModel",
                "bedrock:InvokeModelWithResponseStream"
            ],
            "Resource": [
                "*"
            ]
        }
    ]
}
```

**참고**  
`<Region>`를 실제 AWS 리전으로 바꾸고를 AWS 계정 ID`<account_id>`로 바꿉니다.

## 1단계: 종속성 설치
<a name="browser-strands-install"></a>

```
pip install bedrock-agentcore strands-agents strands-agents-tools playwright nest-asyncio
```

## 2단계: 에이전트 생성
<a name="browser-strands-create"></a>

이름이 `browser_agent.py` 인 파일을 생성합니다.

**참고**  
를 AWS 리전(예: `us-west-2` )`<Region>`으로 바꿉니다.

```
from strands import Agent
from strands_tools.browser import AgentCoreBrowser

# Initialize the Browser tool
browser_tool = AgentCoreBrowser(region="<Region>")

# Create an agent with the Browser tool
agent = Agent(tools=[browser_tool.browser])

# Test the agent with a web search prompt
prompt = "what are the services offered by Bedrock AgentCore? Use the documentation link if needed: https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/what-is-bedrock-agentcore.html"
print(f"\n\nPrompt: {prompt}\n\n")

response = agent(prompt)
print("\n\nAgent Response:")
print(response.message["content"][0]["text"])
```

## 3단계: 에이전트 실행
<a name="browser-strands-run"></a>

```
python browser_agent.py
```

에이전트가 웹 사이트를 탐색하고 AgentCore 서비스에 대한 세부 정보를 반환하는 것을 볼 수 있습니다. 오류가 발생하면 IAM 권한, 모델 액세스 및 AWS 자격 증명을 확인합니다.

## 4단계: 브라우저 세션 라이브 보기
<a name="browser-strands-live-view"></a>

에이전트가 실행되는 동안 AWS 콘솔을 통해 실시간으로 볼 수 있습니다.

1. [AgentCore 브라우저 콘솔](https://us-west-2.console.aws.amazon.com/bedrock-agentcore/builtInTools) 열기 

1. 왼쪽 탐색에서 **기본 제공 도구**로 이동합니다.

1. 브라우저 도구(예: `AgentCore Browser Tool` 또는 사용자 지정 브라우저)를 선택합니다.

1. **브라우저 세션** 섹션에서 **준비**됨 상태의 활성 세션을 찾습니다.

1. **라이브 보기/레코**딩 열에서 제공된 "라이브 세션 보기" URL을 클릭합니다.

라이브 뷰는 자동화에서 제어를 인계하거나 해제할 수 있는 대화형 제어 기능을 갖춘 실시간 비디오 스트림을 제공합니다.

## 리소스 찾기
<a name="browser-find-resources"></a>

AgentCore 브라우저를 사용한 후 AWS 콘솔에서 리소스를 확인합니다.


| \# | Resource | Location | 
| --- | --- | --- | 
| 1 | 라이브 뷰 | 브라우저 콘솔 > 도구 이름 > **라이브 세션 보기**  | 
| 2 | 세션 레코딩 및 재생 | 브라우저 콘솔 > 도구 이름 > **레코딩 보기**  | 
| 3 | 브라우저 로그 |  **CloudWatch** > **로그 그룹** > `/aws/bedrock-agentcore/browser/`  | 
| 4 | 파일 기록 |  **S3** > 버킷 > `browser-recordings/` 접두사 | 
| 5 | 사용자 지정 브라우저 |  **AgentCore 콘솔** > **기본 제공 도구** > 사용자 지정 브라우저 | 
| 6 | IAM 역할 |  **IAM** > **역할** > 실행 역할 검색 | 

## 다음 단계
<a name="browser-next-steps"></a>

이제 AgentCore 브라우저가 작동했으므로 다음과 같은 고급 기능을 살펴봅니다.
+  [세션 레코딩 및 재생](browser-session-recording.md) - 디버깅을 위한 세션 레코딩 및 재생
+  [Nova Act에서 AgentCore Browser](browser-quickstart-nova-act.md) [사용 및 Playwright에서 AgentCore Browser](browser-quickstart-playwright.md) 사용 - Nova Act 또는 Playwright와 같은 다른 프레임워크 사용
+  [기본 사항](browser-resource-session-management.md) - API 작업 및 사용자 지정 브라우저에 대해 알아보기