fix: google results
This commit is contained in:
parent
944e42e857
commit
87cba82ee6
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "txtdot",
|
||||
"version": "1.0.0",
|
||||
"version": "1.1.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "txtdot",
|
||||
"version": "1.0.0",
|
||||
"version": "1.1.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@fastify/static": "^6.10.2",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "txtdot",
|
||||
"version": "1.0.0",
|
||||
"version": "1.1.1",
|
||||
"private": true,
|
||||
"description": "",
|
||||
"main": "dist/app.js",
|
||||
|
@ -10,15 +10,15 @@ export default async function google(
|
||||
] as HTMLAnchorElement[];
|
||||
const googleNames = [...window.document.querySelectorAll(".VuuXrf")];
|
||||
|
||||
const results = googleAnchors.map(
|
||||
(a: HTMLAnchorElement, i: number): GoogleProps => {
|
||||
const results = googleAnchors
|
||||
.map((a: HTMLAnchorElement, i: number): GoogleProps => {
|
||||
return {
|
||||
href: a.href!,
|
||||
siteName: googleNames[i].textContent!,
|
||||
heading: a.childNodes[1].textContent!,
|
||||
heading: a.childNodes[1]?.textContent,
|
||||
};
|
||||
}
|
||||
);
|
||||
})
|
||||
.filter((a) => a.heading);
|
||||
|
||||
if (!googleAnchors) {
|
||||
throw new EngineParseError(
|
||||
@ -90,5 +90,5 @@ export default async function google(
|
||||
interface GoogleProps {
|
||||
href: string;
|
||||
siteName: string;
|
||||
heading: string;
|
||||
heading: string | null;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user