feat(agent): Connect AI 웹사이트 탐색 기능(read_url) 추가 및 웹 스크래핑 구현
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import * as fs from 'fs';
|
||||
const text = fs.readFileSync('src/extension.ts', 'utf-8');
|
||||
const match = text.match(/_getHtml.*?\{([\s\S]*?)^\s*\}/m);
|
||||
if (match) {
|
||||
let inner = match[1];
|
||||
// extract the returned string
|
||||
const strMatch = inner.match(/return\s+`(.*)`/ms);
|
||||
if (strMatch) {
|
||||
fs.writeFileSync('test.html', strMatch[1]);
|
||||
console.log("Wrote test.html length", strMatch[1].length);
|
||||
} else { console.log('no string'); }
|
||||
} else { console.log('no func'); }
|
||||
Reference in New Issue
Block a user