-
-
Notifications
You must be signed in to change notification settings - Fork 199
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
RE: Make this work for your own browser instead of spinning up an artificial one. #8
Comments
I've tried this here: main...rgarcia:vimGPT:feature/issue-8 But when I run it, the browser immediately closes and the script errors out:
|
interesting, I'll play around with this and see if I can get it working. my playwright skills are weak, for some reason when I start it up it makes two tabs as well |
One hacky way is to use PyAutoGui instead of Playwright, if you want to control your own personal browser. |
import { Builder } from "selenium-webdriver";
import chrome from "selenium-webdriver/chrome";
import "chromedriver";
import dotenv from "dotenv";
dotenv.config();
const options = new chrome.Options();
const userDataDir = process.env["CHROME_USER_DATA"];
options.addArguments(`--user-data-dir=${userDataDir}`);
options.addArguments(`--profile-directory=Profile\ 1`);
const driver = await new Builder()
.setChromeOptions(options)
.forBrowser("chrome")
.build();
This is how I do it in TypeScript + Selenium. |
You can pass the path to your chrome user data file to chromium like this I think eg:
f"--user-data-dir={os.environ.get('CHROME_USER_DATA')}"
.env (eg for windows)
CHROME_USER_DATA = "c:\\Users\\<user name>\\AppData\\Local\\Google\\Chrome\\User Data\\"
The text was updated successfully, but these errors were encountered: