# How to control a browser with GPT-3

In this tutorial, we will see how to control a browser with GPT-3 using just text prompts.

This article is inspired by this [tweet thread](https://twitter.com/natfriedman/status/1575631194032549888) and the credit for the code and method used in this tutorial goes to the author of the tweet thread.

Table of Contents

*   [Control a browser with GPT-3](https://harishgarg.com/#Control_a_browser_with_GPT-3)
    *   [Requirements](https://harishgarg.com/#Requirements)
    *   [Setup & Usage](https://harishgarg.com/#Setup_Usage)

Control a browser with GPT-3
----------------------------

### Requirements

*   An OpenAI GPT-3 account
*   A Computer equipped with Python 3.x and a command line program

### Setup & Usage

1.  Get the code from this [repo](https://github.com/nat/natbot/blob/main/natbot.py).
2.  Get your OpenAI API key from your [OpenAI account](https://beta.openai.com/)
3.  Open your command line program
4.  In the command line program, set an environment variable OPENAI\_API\_KEY with your OpenAI API key as its value.
5.  In the command line program, change the directory to the code repo from step 1 above.
6.  Run the code file by using this command _**python natbot.py**_
7.  Follow the instructions on the terminal
