Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when searching on google.com #24

Open
Fabrizio1990 opened this issue Feb 27, 2023 · 0 comments
Open

Error when searching on google.com #24

Fabrizio1990 opened this issue Feb 27, 2023 · 0 comments

Comments

@Fabrizio1990
Copy link

Hi, i have this code:
`const serp = require("serp");

const keyword = "bici sportiva";

var options = {
host: "google.com",
qs: {
q: keyword,
filter: 0,
pws: 0,
},
num: 100,
};

const getLinks = async () => {
console.log("fetching google...");
const links = await serp.search(options);
console.log("links", links);
};

getLinks();
`
it work on google.it but not on google.com (also tried to remove host option ad set num to 10), the resulting error is:

(node:64929) UnhandledPromiseRejectionWarning: Error: Invalid HTTP status code on undefined
at requestFromBrowser (/Users/fabriziocoppolecchia/Desktop/Progetti/Freelance sharing/Tools Fabio/serpPositionSearch/node_modules/serp/index.js:125:11)
at runNextTicks (internal/process/task_queues.js:58:5)
at processImmediate (internal/timers.js:434:9)
at async execRequest (/Users/fabriziocoppolecchia/Desktop/Progetti/Freelance sharing/Tools Fabio/serpPositionSearch/node_modules/serp/index.js:110:19)
at async doRequest (/Users/fabriziocoppolecchia/Desktop/Progetti/Freelance sharing/Tools Fabio/serpPositionSearch/node_modules/serp/index.js:90:18)
at async Object.search (/Users/fabriziocoppolecchia/Desktop/Progetti/Freelance sharing/Tools Fabio/serpPositionSearch/node_modules/serp/index.js:38:20)
at async getLinks (/Users/fabriziocoppolecchia/Desktop/Progetti/Freelance sharing/Tools Fabio/serpPositionSearch/index.js:20:17)
(Use node --trace-warnings ... to show where the warning was created)
(node:64929) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:64929) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@Fabrizio1990 Fabrizio1990 changed the title Error when searching on google .com Error when searching on google.com Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant