Open richardzhu64 opened 3 years ago
Maybe cookie consent popup that shows up when cookies are not set block somehow getting the google search results.
It actually seems that problem is in parse_async method of GoogleScraper class. The parsed html changed so query selectors need to be updated ie:
let serp_obj = {
link: _attr(el, '.rc a', 'href'),
title: _text(el, '.rc a h3'),
snippet: _text(el, '.rc > div:nth-child(2) span span'),
visible_link: _text(el, '.rc cite'),
date: _text(el, '.rc > div:nth-child(2) span.f'),
};
Hi @richardzhu64 I have created PR for this issue https://github.com/NikolaiT/se-scraper/pull/82/files Could you let me know if this fixed your google results as well?
Hi @przemek-nowicki It is working for few pages and for few it doesn't Here attached - it is working for alibaba.txt but it is not working for carloan.txt alibaba.txt carloan.txt
Also, are you able to fetch ads as for me none of them are showing ads
Hi @pankajjha I fixed selectors for organic search results only.
Hello,
I'm working on a project where I am trying to search google with a few keywords in Chinese. Currently, there are no error messages being shown in the terminal, and the return value shows "no_results": false - however, there are no results and the num_results is empty.
My scraping scripti is here:
`const se_scraper = require('se-scraper');
(async () => { /* let browser_config = { test_evasion: true, output_file: 'scraped_urls_manual_google.json', search_engine: "baidu", sleep_range: "",//[70,150], random_user_agent: true, debug: true, keywords: clean_terms }
})();`
I get the following output when running the script:
{ "\"阿尔及利亚TAMANRASSET至In Salah饮用水供给工程项下水井项目 水井项目子项目3:2眼水井及35眼观测井的成井\"": { "1": { "num_results": "", "no_results": false, "effective_query": "", "right_info": {}, "results": [], "top_products": [], "right_products": [], "top_ads": [], "bottom_ads": [], "places": [], "time": "Tue, 06 Oct 2020 04:28:36 GMT" } }, "\"突尼斯斯菲西发水坝\"": { "1": { "num_results": "", "no_results": false, "effective_query": "", "right_info": {}, "results": [], "top_products": [], "right_products": [], "top_ads": [], "bottom_ads": [], "places": [], "time": "Tue, 06 Oct 2020 04:30:13 GMT" } }, "\"苏丹石油1/2/4区CANNER地面设施及长输管道项目\"": { "1": { "num_results": "", "no_results": false, "effective_query": "", "right_info": {}, "results": [], "top_products": [], "right_products": [], "top_ads": [], "bottom_ads": [], "places": [], "time": "Tue, 06 Oct 2020 04:32:35 GMT" } }, "\"阿尔及尔BAB EZZOUAR 1号地1577套住宅商业服务层部分的设计与施工\"": { "1": { "num_results": "", "no_results": false, "effective_query": "", "right_info": {}, "results": [], "top_products": [], "right_products": [], "top_ads": [], "bottom_ads": [], "places": [], "time": "Tue, 06 Oct 2020 04:34:47 GMT" } } }
I've also attached an image of the console while my script is running. Do we know how to resolve this issue where there aren't any apparent errors, but there are no results or links returned for when scraping Google? Previously I was able to do this successfully, but running it again seems to have broken something.
Thanks!![console scraping](https://user-images.githubusercontent.com/28633413/95363727-d61c5200-089d-11eb-88d2-503af8716c74.JPG)