Closed mrepol742 closed 3 months ago
Same error here. It was working perfectly but this week it started to return an empty list
I can see only the knowledge panel and the "people also ask" section. Everything else appears to be empty/null.
Have done a quick hack replacing SELECTORS with below in constants.js since Google has done some changes.
SELECTORS: { // Organic Search Results TITLE: 'div.q8U8x.oewGkc.LeUQr', DESCRIPTION: 'div.MUxGbd.yDYNvb', URL: 'a.C8nzq.BmP5tf',
This is for if you are just scraping the pages. For other elements, obviously have to do deeper research and do changes.
Have done a quick hack replacing SELECTORS with below in constants.js since Google has done some changes.
SELECTORS: { // Organic Search Results TITLE: 'div.q8U8x.oewGkc.LeUQr', DESCRIPTION: 'div.MUxGbd.yDYNvb', URL: 'a.C8nzq.BmP5tf',
This is for if you are just scraping the pages. For other elements, obviously have to do deeper research and do changes.
Thanks it works!
Have done a quick hack replacing SELECTORS with below in constants.js since Google has done some changes.
SELECTORS: { // Organic Search Results TITLE: 'div.q8U8x.oewGkc.LeUQr', DESCRIPTION: 'div.MUxGbd.yDYNvb', URL: 'a.C8nzq.BmP5tf',
This is for if you are just scraping the pages. For other elements, obviously have to do deeper research and do changes.
how can i change the file and work?pls.
This fix worked for me #73
Updated description selector (Constants.SELECTORS.DESCRIPTION
) in file /lib/utils/constants.js
to div[data-snc] > div:nth-child(2) > div
Nothing worked for me
The issue is related to changed selectors, try my fork - https://github.com/CROSP/google-this/tree/main
Or use the following selectors by directly changing the contants.js file
SELECTORS: {
// Organic Search Results
TITLE: 'a[role="presentation"][ping][data-ved] div[aria-level="3"][role="heading"]',
DESCRIPTION: 'div[data-sncf="1"] div',
URL: 'a[role="presentation"][ping][data-ved]',
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Steps to reproduce
const google = require('googlethis');
const response = await google.search('googlethis', {page: 0}); console.log(response);
Failure Logs
Expected behavior
I am expecting the
{results[]}
to return an array of webpages consist of urls, descriptions and favicons of the webpages.`Current behavior
It returned empty
{results: []}
Version
Default
Anything else?
No response
Checklist