From c9465bba9133bab8a6f5eda4080d48f36fead901 Mon Sep 17 00:00:00 2001 From: xiang <1984871009@qq.com> Date: Sun, 4 Jun 2023 12:43:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=BB=98=E8=AE=A4=E4=BD=BF=E7=94=A8gpt4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/forefront/index.ts | 7 ++----- pool/puppeteer.ts | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/model/forefront/index.ts b/model/forefront/index.ts index 9468b72..e1acd0f 100644 --- a/model/forefront/index.ts +++ b/model/forefront/index.ts @@ -87,11 +87,8 @@ export class Forefrontnew extends Chat { console.log('try save cookie'); console.log('save cookie successfully') } finally { - const se = await this.page.$('#model-select'); - if (se) { - await this.page.click('#model-select'); - await this.page.select('#model-select', 'gpt-4') - } + await this.page.waitForSelector('.absolute > .shadow > .w-full:nth-child(2) > .flex > .font-medium',{timeout:100000}); + await this.page.click('.absolute > .shadow > .w-full:nth-child(2) > .flex > .font-medium'); } console.log('try to find input'); await this.page.waitForSelector('.relative > .flex > .w-full > .text-th-primary-dark > div', { diff --git a/pool/puppeteer.ts b/pool/puppeteer.ts index 6b475e7..e6c25cf 100644 --- a/pool/puppeteer.ts +++ b/pool/puppeteer.ts @@ -14,7 +14,7 @@ export class FreeBrowser { constructor(id: string, options?: PuppeteerLaunchOptions) { this.options = { - userDataDir: path.join(runPath, id), + // userDataDir: path.join(runPath, id), ...options }; this.id = id;