Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable stealth options which block login iframe #64

Merged
merged 2 commits into from
Jul 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion schwab_api/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import asyncio
from playwright.async_api import async_playwright, TimeoutError
from playwright_stealth import stealth_async
from playwright_stealth.stealth import StealthConfig
from requests.cookies import cookiejar_from_dict


Expand Down Expand Up @@ -135,7 +136,12 @@ async def _async_login(self):
user_agent=user_agent,
viewport=VIEWPORT
)
await stealth_async(self.page)

config = StealthConfig()
config.navigator_languages = False
config.navigator_user_agent = False
config.navigator_vendor = False
await stealth_async(self.page, config)

await self.page.goto("https://www.schwab.com/")
await self.page.route(re.compile(r".*balancespositions*"), self._asyncCaptureAuthToken)
Expand Down