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