File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121 run : |
2222 ls -la
2323 - uses : ./get-html
24+ name : test some URL
2425 with :
2526 url : https://opentermsarchive.org
2627 output : result.html
2728 - shell : bash
2829 run : |
2930 cat result.html | grep Accessibilité
31+ - uses : ./get-html
32+ name : test user-agent
33+ with :
34+ url : https://httpbin.org/user-agent
35+ output : user-agent.html
36+ - shell : bash
37+ run : |
38+ cat user-agent.html | grep dashlord
Original file line number Diff line number Diff line change @@ -11,10 +11,11 @@ const getHTML = async (url) => {
1111 `--lang=${ LANGUAGE } ` ,
1212 ] ,
1313 } ) ;
14-
14+ const userAgent = await browser . userAgent ( ) ;
1515 let html = "" ;
1616 try {
1717 const page = await browser . newPage ( ) ;
18+ await page . setUserAgent ( `${ userAgent } - dashlord` ) ;
1819 await page . goto ( url ) ;
1920 await page . waitForTimeout ( 5000 ) ; // wait some time, some SPA may load asynchronously (ex: angular)
2021 const frame = await page . mainFrame ( ) ;
You can’t perform that action at this time.
0 commit comments