diff --git a/gpt.ts b/gpt.ts new file mode 100644 index 0000000..0da9ac7 --- /dev/null +++ b/gpt.ts @@ -0,0 +1,26 @@ +import { Builder, By, Capabilities, WebDriver } from 'selenium-webdriver'; +import waitAnyKey from './waitAnyKey'; + +(async function secondTest() { + let driver: WebDriver | null = null; + + try { + + // Selenium Server URL (Assuming your Selenium Server is running on localhost at port 4444) + // http://150.230.239.12:7900/?autoconnect=1&resize=scale&password=secret + const seleniumServerUrl = "http://150.230.239.12:4444/wd/hub"; + const capabilities = Capabilities.firefox(); + + // 创建一个 WebDriver 实例 + driver = new Builder() + .usingServer(seleniumServerUrl) + .withCapabilities(capabilities) + .build(); + + } catch (e) { + console.log(e) + } finally { + await waitAnyKey(); + await driver?.quit(); + } +}()) \ No newline at end of file diff --git a/second.ts b/second.ts index 76549ad..22bc115 100644 --- a/second.ts +++ b/second.ts @@ -24,7 +24,6 @@ import waitAnyKey from './waitAnyKey'; } catch (e) { console.log(e) } finally { - await new Promise(resolve => setTimeout(resolve, 5 * 1000)); await waitAnyKey(); await driver?.quit(); }