I have some Chrome profiles in which I have my different accounts logged in. I'm writing a multi-threaded script that will run each profile using launch_persistent_context so that I'm already logged in and script starts working from thereon.
I'm using Playwright, on Windows 10.
Here's my code snippet which works for only one profile (I'm not sure why, because the profile it opens is Profile 1 in my file-path, however the script works only for the parent directory, and that too for only a single profile)
def run(playwright: Playwright) -> None:
browser = playwright.chromium.launch_persistent_context(
channel="chrome", user_data_dir=r"C:\\Users\\Home\\AppData\\Local\\Google\\Chrome\\User Data", headless=False)
page = browser.new_page()
I'm facing difficulties in running all the Chrome profiles simultaneously or even sequentially.
I looked at the docs and GitHub issues but I'm not sure what to do.