CoolFace
Apppublic

deepak191z/playwright2

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
test_evaluate.mjs51 linesDownload Raw Back to root
1// let res = await fetch('https://gowah44030-playwright.hf.space/evaluate', {2//     method: "POST",3//     body: JSON.stringify({4//         url: 'https://chat.lmsys.org/assets/index-c347e3dc.js',5//         code: `6//         (async function(){7//             return await new Promise(async (resolve)=>{8                     9//              try {10//                 //resolve(await fetch('https://chat.lmsys.org').then(res=>res.text()));11//              } catch (e) { resolve(e);}12//              //return;13 14 15//                 const ws = new WebSocket('wss://chat.lmsys.org/queue/join');16//                 ws.addEventListener('error', (e) => { resolve('error');});17//                 ws.addEventListener('open', function open() { resolve('open');});18//                 ws.addEventListener('close', () => { resolve('A') });19 20//                 //ws.on('message', function message(_data) { console.log(_data);});21//             });22//         })()23//         `,24//     })25// }).then(res=>res.text());26 27let res = await fetch('https://gowah44030-playwright.hf.space/evaluate', {28    method: "POST",29    body: JSON.stringify({30        url: 'https://www.investing.com',31        code: `32        (async function(){33            return await new Promise(async (resolve)=>{34                     35                try {36                    resolve(37                        await fetch('https://api.investing.com/api/financialdata/8849/historical/chart/?interval=PT1M&pointscount=60')38                        //await fetch('https://www.investing.com')39                        .then(res=>{40                            return res.text();41                        })42                    );43                } catch (e) { resolve(e);}44             45            });46        })()47        `,48    })49}).then(res=>res.text());50 51console.log(res);