Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.
Python ai-agentsai-toolsbrowser-agentbrowser-automationbrowser-usecdpcloud-browsercomputer-useheadless-browserllmmcpplaywrightpythonremote-browserstealth-browserweb-automationweb-scraping
Remove x example
Magnus Müller5242cb5cb1e2
diff --git a/examples/use-cases/twitter_post_using_cookies.py b/examples/use-cases/twitter_post_using_cookies.pydeleted file mode 100644index 8c674a9cb..000000000--- a/examples/use-cases/twitter_post_using_cookies.py+++ /dev/null@@ -1,45 +0,0 @@-# Goal: Automates posting on X (Twitter) using stored authentication cookies.--import asyncio-import os-import sys--sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))--from dotenv import load_dotenv--load_dotenv()---from browser_use import Agent-from browser_use.browser import BrowserProfile, BrowserSession-from browser_use.llm import ChatGoogle--api_key = os.getenv('GOOGLE_API_KEY')-if not api_key:- raise ValueError('GOOGLE_API_KEY is not set')--llm = ChatGoogle(model='gemini-2.0-flash-exp', api_key=api_key)---browser_session = BrowserSession(- browser_profile=BrowserProfile(- user_data_dir='~/.config/browseruse/profiles/default',- # executable_path='/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',- )-)---async def main():- agent = Agent(- browser_session=browser_session,- task=('go to https://x.com. write a new post with the text "browser-use ftw", and submit it'),- llm=llm,- max_actions_per_step=4,- )- await agent.run(max_steps=25)- input('Press Enter to close the browser...')---if __name__ == '__main__':- asyncio.run(main())