initial commit
This commit is contained in:
36
playwright_t.py
Normal file
36
playwright_t.py
Normal file
@@ -0,0 +1,36 @@
|
||||
from playwright.sync_api import sync_playwright
|
||||
import time
|
||||
|
||||
with sync_playwright() as p:
|
||||
# Launch a browser
|
||||
browser = p.chromium.launch(headless=False) # Set headless=True if you don't want to see the browser
|
||||
page = browser.new_page()
|
||||
|
||||
# Go to the login page
|
||||
page.goto("https://www.investidor.b3.com.br/login")
|
||||
|
||||
# Fill in the username and password
|
||||
page.fill('input[name="investidor"]', '01783945052')
|
||||
page.click('button[type="submit"]')
|
||||
|
||||
time.sleep(2)
|
||||
|
||||
page.fill('input[type="password"]', 'malvado6696')
|
||||
|
||||
time.sleep(200)
|
||||
page.click('input[type="checkbox"]')
|
||||
page.click('button[type="submit"]')
|
||||
|
||||
|
||||
# Wait for navigation or any element that confirms login success
|
||||
page.wait_for_load_state('networkidle')
|
||||
|
||||
# Go to the protected page
|
||||
page.goto("https://example.com/secret-page")
|
||||
|
||||
# Get the page content
|
||||
content = page.content()
|
||||
print(content)
|
||||
|
||||
# Close the browser
|
||||
#browser.close()
|
||||
Reference in New Issue
Block a user