Function searchWithPages

  • Searches google with the given query, returns results for multiple pages. google uses cursor-based pagination (using param start=number).

    Therefore, when providing the specific page numbers, make sure to provide it in 10 increments.

    Type Parameters

    Parameters

    Returns Promise<SearchResultTypeFromSelector<R>[][]>

    Search results as an array of SearchResultNodes or an array of arrays of SearchResultNodes

    // search the first 5 pages
    const results = await searchWithPages({
    query: "hello world",
    pages: 5,
    });

    // or provide the specific page numbers
    const results = await searchWithPages({
    query: "hello world",
    pages: [0, 10, 20, 30, 40],
    });

    // pages can be skipped or be out of order
    const results = await searchWithPages({
    query: "hello world",
    pages: [10, 0, 20],
    });
  • Searches google with the given query, returns results for multiple pages. google uses cursor-based pagination (using param start=number).

    Therefore, when providing the specific page numbers, make sure to provide it in 10 increments.

    Type Parameters

    Parameters

    Returns Promise<SearchResultTypeFromSelector<R, true>[][]>

    Search results as an array of SearchResultNodes or an array of arrays of SearchResultNodes

    // search the first 5 pages
    const results = await searchWithPages({
    query: "hello world",
    pages: 5,
    });

    // or provide the specific page numbers
    const results = await searchWithPages({
    query: "hello world",
    pages: [0, 10, 20, 30, 40],
    });

    // pages can be skipped or be out of order
    const results = await searchWithPages({
    query: "hello world",
    pages: [10, 0, 20],
    });