LuanRT / google-this

A simple yet powerful module to retrieve organic search results and much more from Google.
https://www.npmjs.com/package/googlethis
MIT License
316 stars 77 forks source link

[1.8.0] Not working anymore #78

Open mrgoonie opened 1 month ago

mrgoonie commented 1 month ago

Steps to reproduce

Just search anything

Failure Logs

{
  results: [],
  videos: [],
  knowledge_panel: KnowledgeGraph {
    type: null,
    title: null,
    description: null,
    url: null,
    metadata: [],
    books: [],
    tv_shows_and_movies: [],
    ratings: [],
    available_on: [],
    images: [],
    songs: [],
    socials: [],
    demonstration: null,
    lyrics: null
  },
  featured_snippet: FeaturedSnippet { title: null, description: null, url: null },
  did_you_mean: null,
  weather: Weather {
    location: null,
    forecast: null,
    precipitation: null,
    humidity: null,
    temperature: null,
    wind: null,
    image: null
  },
  time: Time { hours: null, date: null },
  location: Location { title: null, distance: null, map: null },
  dictionary: Dictionary {
    word: null,
    phonetic: null,
    audio: null,
    definitions: [],
    examples: []
  },
  translation: Translation {
    source_language: null,
    target_language: null,
    source_text: null,
    target_text: null
  },
  top_stories: [],
  unit_converter: Converters {},
  people_also_ask: [
    'What is the best PS5 game right now?',
    'Which games come with the PS5?',
    'What game shall I play PS5?',
    'Resident Evil 4',
    'Gran Turismo 7',
    '…',
    'Initial release date: March 4, 2022',
    'Elden Ring',
    '…',
    'Initial release date: February 25, 2022',
    'God of War Ragnarök',
    '…',
    'Initial release date: November 9, 2022'
  ],
  people_also_search: []
}

Expected behavior

work as expected

Current behavior

not working

Version

Default

Anything else?

nothing

Checklist

farzad-845 commented 1 month ago

same issue, confirming it returns null.

Vaib215 commented 1 month ago

same

JvB94 commented 1 month ago

same

LuanRT commented 1 month ago

This package is quite old and I haven't used it myself in a long time, so this was going to happen. To fix it, I probably need to rewrite it so that it doesn't rely so much on selectors ~ they are very unreliable.

Khaogamermain01 commented 2 weeks ago

Seems like this fork fixed it already with 1 commit: https://github.com/CROSP/google-this

> bun run testing.ts                          
{
  results: [
    OrganicResult {
      title: "Stephen Hawking",
      description: "Stephen William Hawking, CH, CBE, FRS, FRSA (8 January 1942 – 14 March 2018) was an English theoretical physicist, ...",
      url: "https://en.wikipedia.org/wiki/Stephen_Hawking",
      is_sponsored: false,
      favicons: [Object ...],
    }, OrganicResult {
      title: "Stephen Hawking | Facts, Biography, Books, & Theories",
      description: "Stephen William Hawking, CH, CBE, FRS, FRSA (8 January 1942 – 14 March 2018) was an English theoretical physicist, ...",
      url: "https://www.britannica.com/biography/Stephen-Hawking",
      is_sponsored: false,
      favicons: [Object ...],
    }, OrganicResult {
      title: "Stephen Hawking",
      description: "Jun 21, 2567 BE — Stephen Hawking, the brilliant British physicist and cosmologist, revolutionized our understanding of black ...",
      url: "https://m.imdb.com/name/nm0370071/",
      is_sponsored: false,
      favicons: [Object ...],
    }, OrganicResult {
      title: "'Mind over matter': Stephen Hawking – obituary by Roger Penrose",
      description: "Jun 21, 2567 BE — Stephen Hawking, the brilliant British physicist and cosmologist, revolutionized our understanding of black ...",
      url: "https://www.theguardian.com/science/2018/mar/14/stephen-hawking-obituary",
      is_sponsored: false,
      favicons: [Object ...],
    }
  ],
  videos: [],
  knowledge_panel: KnowledgeGraph {
    type: null,
    title: null,
    description: "Stephen William Hawking, CH, CBE, FRS, FRSA was an English theoretical physicist, cosmologist, and author who was director of research at the Centre for Theoretical Cosmology at the University of Cambridge. Wikipedia",
    url: "https://en.wikipedia.org/wiki/Stephen_Hawking",
    metadata: [
      [Object ...], [Object ...], [Object ...], [Object ...], [Object ...]
    ],
    books: [],
    tv_shows_and_movies: [],
    ratings: [],
    available_on: [],
    images: [],
    songs: [],
    socials: [],
    demonstration: null,
    lyrics: null,
  },
  featured_snippet: FeaturedSnippet {
    title: null,
    description: null,
    url: null,
  },
  did_you_mean: null,
  weather: Weather {
    location: null,
    forecast: null,
    precipitation: null,
    humidity: null,
    temperature: null,
    wind: null,
    image: null,
  },
  time: Time {
    hours: null,
    date: null,
  },
  location: Location {
    title: null,
    distance: null,
    map: null,
  },
  dictionary: Dictionary {
    word: null,
    phonetic: null,
    audio: null,
    definitions: [],
    examples: [],
  },
  translation: Translation {
    source_language: null,
    target_language: null,
    source_text: null,
    target_text: null,
  },
  top_stories: [],
  unit_converter: Converters {},
  people_also_ask: [ "What was Stephen Hawking's IQ when he died?", "How long has Stephen Hawking been in a wheelchair?",
    "What all did Stephen Hawking discover?"
  ],
  people_also_search: [],
}