Skip to content

Commit

Permalink
fix: possible fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mxvsh committed Jul 16, 2021
1 parent a54c3cd commit 350613f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/modules/google/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ const Answer = async (ctx, params?) => {

const $ = cheerio.load(data);
const calcAns = $("input[jsname='fPLMtf']");
if (calcAns) answer = `<b>${String(calcAns.val())}</b>`;
else
for (let _class of classes) {
let text = $(`.${_class}`).text();
if (text) {
if (text.startsWith("Description")) {
text = text.replace(/^Description/g, "");
}
answer = `<b>${text}</b>`;
break;
for (let _class of classes) {
let text = $(`.${_class}`).text();
if (text) {
if (text.startsWith("Description")) {
text = text.replace(/^Description/g, "");
}
answer = `<b>${text}</b>`;
break;
}
}

if (!answer) answer = String(calcAns.val());
})
.catch((err) => {
answer = "Not found.";
Expand Down

0 comments on commit 350613f

Please sign in to comment.