feat(agent): Connect AI 웹사이트 탐색 기능(read_url) 추가 및 웹 스크래핑 구현
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
const Module = require('module');
|
||||
const originalRequire = Module.prototype.require;
|
||||
Module.prototype.require = function(request) {
|
||||
if (request === 'vscode') return {};
|
||||
return originalRequire.apply(this, arguments);
|
||||
};
|
||||
|
||||
const fs = require('fs');
|
||||
const code = fs.readFileSync('out/extension.js', 'utf8');
|
||||
const match = code.match(/_getHtml.*?(<!DOCTYPE html>[\s\S]*?)<\/html>.*?;/m);
|
||||
if (match) {
|
||||
const html = match[1] + "</html>";
|
||||
const lines = html.split('\n');
|
||||
console.log("Total lines:", lines.length);
|
||||
// print from line 60 to end
|
||||
}
|
||||
Reference in New Issue
Block a user