File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,20 @@ const puppeteer = require('puppeteer');
17
17
// Locate the title
18
18
// Print the title
19
19
20
+ await page . click ( '.DocSearch-Button' ) ;
21
+ const searchBoxSelector = '.DocSearch-Input' ;
22
+ await page . waitForSelector ( searchBoxSelector ) ;
23
+ await page . type ( searchBoxSelector , 'andy popoo' ) ;
24
+
25
+ await page . locator ( '#docsearch-hits1-item-4 > a:nth-child(1) > div:nth-child(1)' ) . click ( ) ;
26
+ // await page.waitForSelector(`.theme-doc-markdown > header:nth-child(1) > h1:nth-child(1)').innerText`);
27
+ await new Promise ( r => setTimeout ( r , 1000 ) ) ;
28
+ title = await page . evaluate ( `document.querySelector('.theme-doc-markdown > header:nth-child(1) > h1:nth-child(1)').innerText ` ) ;
29
+ console . log ( title ) ;
30
+
31
+ await page . screenshot ( { path : 'screenshot.png' } ) ;
32
+
33
+
20
34
// Close the browser
21
35
await browser . close ( ) ;
22
- } ) ( ) ;
36
+ } ) ( ) ;
You can’t perform that action at this time.
0 commit comments