Skip to content

Commit

Permalink
test: 添加注释
Browse files Browse the repository at this point in the history
  • Loading branch information
fanyong920 committed Dec 26, 2024
1 parent 88e38ab commit abca6d2
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,16 @@ public void test9() throws Exception {
Browser browser = Puppeteer.launch(launchOptions);
String endpoint = browser.wsEndpoint();
Process process = browser.process();
// 获取进程的pid
long pid = Helper.getPidForLinuxOrMac(process);
browser.disconnect();
ConnectOptions connectOptions = new ConnectOptions();
//重连必须指定一个协议
connectOptions.setProtocol(Protocol.CDP);
//构建自己的 Transport
ConnectionTransport connectionTransport = createConnectionTransport(endpoint);
connectOptions.setTransport(connectionTransport);
//重连
Browser connectBrowser = Puppeteer.connect(connectOptions);
Page page = connectBrowser.newPage();
page.goTo("http://example.com");
Expand Down

0 comments on commit abca6d2

Please sign in to comment.