Browser Use can write Javascript
Agents can now write and execute JavaScript code to interact with websites
In your prompts you can now prompt the agent to write JavaScript code to interact with elements on the website.
This enables more precise control and complex interactions that go beyond standard browser automation—perfect for handling edge cases or custom behaviors.
from browser_use import Agent
agent = Agent(
task="Write JavaScript to extract all product prices from the page",
llm=llm
)
result = await agent.run()The agent will automatically write and execute the necessary JavaScript to complete your task.