Coder Social home page Coder Social logo

Comments (11)

BisratGetnet avatar BisratGetnet commented on September 1, 2024 2

just use 'googlesearch' liberary by
author = 'Anime no Sekai'
copyright = 'Copyright 2021, googlesearch'
credits = ['animenosekai']
license = 'MIT License'
version = 'googlesearch v1.1.1'
maintainer = 'Anime no Sekai'
email = '[email protected]'
status = 'Stable'

it works fine for me

from googlesearch.

kenuxi avatar kenuxi commented on September 1, 2024

I get the same problem

from googlesearch.

BisratGetnet avatar BisratGetnet commented on September 1, 2024

Same here. Can anyone help me?

from googlesearch.

DerSchinken avatar DerSchinken commented on September 1, 2024

I think it's because the selector is not working
So we can just wait until it gets fixed

from googlesearch.

SillyGithub5 avatar SillyGithub5 commented on September 1, 2024

Same here

from googlesearch.

afifabroory avatar afifabroory commented on September 1, 2024

I fixed the problem, by change RESULT_SELECTOR = "div.g" to RESULT_SELECTOR = "div.g>div>div"
(Update!) NEW SOLUTION HERE: #75 (comment)

RESULT_SELECTOR = "div.g"

and then, replace code line 70 with selector = GoogleSearch.RESULT_SELECTOR or just delete it and change soup.select() argument (line 71) with self.RESULT_SELECTOR

selector = GoogleSearch.RESULT_SELECTOR_PAGE1 if i == 0 else GoogleSearch.RESULT_SELECTOR
self.results = self.parse_results(soup.select(selector), i)

Here my output
output

from googlesearch.

BisratGetnet avatar BisratGetnet commented on September 1, 2024

self.RESULT_SELECTOR

KeyError: 'href' when trying your fix

from googlesearch.

afifabroory avatar afifabroory commented on September 1, 2024

@BisratGetnet I have new solution here

Change RESULT_SELECTOR to:

RESULT_SELECTOR = "div.g>div>div.tF2Cxc"

Here my output, for my new solution
results2
it's remove duplicate result (you can compare with my previous screenshot)

from googlesearch.

BisratGetnet avatar BisratGetnet commented on September 1, 2024

@BisratGetnet I have new solution here

Change RESULT_SELECTOR to:

RESULT_SELECTOR = "div.g>div>div.tF2Cxc"

Here my output, for my new solution
results2
it's remove duplicate result (you can compare with my previous screenshot)

Thanks for replaying but still same error i think it's because google user different selector in different countries can you show me how to take a selector based on google search results.

from googlesearch.

afifabroory avatar afifabroory commented on September 1, 2024

Thanks for replaying but still same error i think it's because google user different selector in different countries can you show me how to take a selector based on google search results.

Ah... okay.

You need to open Inspect on your browser, and then select element that you want to scrape, after that right click element and then copy Selector/CSS Selector. Alternatively you can find element manually.

To test whether the element being searched for is correct, you can test using method querySelectorAll or querySelector on your Console.

for example:

document.querySelectorAll('div.g>div>div.tF2Cxc');

Here's reference for CSS Selector:
https://www.w3schools.com/cssref/css_selectors.asp

Sorry if my explanation is not detailed enough or makes you confused because of my English 🙈, hope it helps you.

from googlesearch.

frankiejou avatar frankiejou commented on September 1, 2024

I only got "HTTPError: Too Many Requests", anyone can help?

from googlesearch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.