From dfbacde1fdb95452233308731c0670abf3ac94bf Mon Sep 17 00:00:00 2001 From: Philipp Tanlak Date: Thu, 12 Oct 2023 18:57:21 +0200 Subject: Replace v8go with goja --- js_test.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'js_test.go') diff --git a/js_test.go b/js_test.go index 9366a15..2cf8f25 100644 --- a/js_test.go +++ b/js_test.go @@ -23,18 +23,14 @@ var html = ` ` var script = ` -import { parse } from "flyscrape"; - export const config = { url: "https://localhost/", } -export default function({ html, url }) { - const $ = parse(html); - +export default function({ doc, url }) { return { - headline: $("h1").text(), - body: $("p").text(), + headline: doc.find("h1").text(), + body: doc.find("p").text(), url: url, } } -- cgit v1.2.3