Run a simple example query
Run a simple query to test that everything is working as expected. In this example it is assumed that you have successfully installed the Bytebot SDK and Puppeteer. If not, please refer to the installation guide.
Make sure you import Puppeteer and the Bytebot client:
Use Puppeteer to navigate to a page:
This is only an example of how to use Puppeteer to navigate to a page. We suggest you visit the Puppeteer documentation for more information.
Instantiate a Bytebot client and execute your query:
You can print the extract action:
This example (as well as all extract prompts) resolves to a single action, but it is good practice to not make assumptions about the number of actions returned. In some circumstances you will need to handle multiple actions.
And see something like this:
You can then execute the generated action on the same page reference:
The console should display something like this:
Finally, make sure you close the Puppeteer browser:
Congratulations! You have successfully run your first query using Bytebot.