mirror of
https://github.com/j93es/browser-use-oauth.git
synced 2026-06-13 23:56:42 +09:00
지금 일단 업데이트만 해뒀어요
This commit is contained in:
parent
09a91f9c7c
commit
e1ae2dc94f
9 changed files with 713 additions and 173 deletions
22
login.py
Normal file
22
login.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
from playwright.sync_api import sync_playwright
|
||||
|
||||
def launch_browser_with_profile():
|
||||
p = sync_playwright().start()
|
||||
browser = p.chromium.launch_persistent_context(
|
||||
user_data_dir="./data/user_data",
|
||||
headless=False
|
||||
)
|
||||
page = browser.new_page()
|
||||
return browser, page, p
|
||||
|
||||
if __name__ == "__main__":
|
||||
browser, page, playwright = launch_browser_with_profile()
|
||||
page.goto("https://example.com")
|
||||
print("Browser launched with user data profile.")
|
||||
|
||||
# 브라우저가 열린 상태를 유지
|
||||
input("Press Enter to close the browser...")
|
||||
|
||||
# 리소스 정리
|
||||
browser.close()
|
||||
playwright.stop()
|
||||
Loading…
Add table
Add a link
Reference in a new issue