1

I'm trying to perform a google search using python, using the googlesearch python module. I don't just want urls to be outputted, I also want a description of the information in the url, basically web scraping.

Here's the code that includes the advanced argument:

from googlesearch import search

print(search('my search', advanced=True)) #advanced argument is true, to make the search detailed

but I get this error:

TypeError: search() got an unexpected keyword argument 'advanced'

and I don't know why this is occurring.

I got this code from https://pypi.org/project/googlesearch-python. I would also like to note that I don't want to use other web scraping libraries, such as bs4 (BeatifulSoup4) or urllib, especially since I want to figure out why the advanced argument isn't being accepted.

11
  • Please post the complete stacktrace you get Commented Jan 4, 2024 at 22:39
  • How did you install it ? What version you have ? Commented Jan 4, 2024 at 23:04
  • @MarkusSafar, what do you mean by stacktrace? I installed it using pip, and I have version 3.0.0 currently. Commented Jan 4, 2024 at 23:08
  • Python version 3 ? Or google search version 3 ? Commented Jan 4, 2024 at 23:11
  • Google search version 3. Commented Jan 4, 2024 at 23:13

1 Answer 1

1

Try installing it using :

pip install googlesearch-python
Sign up to request clarification or add additional context in comments.

4 Comments

That worked, but now when I run search('my search', advanced=True) it doesn't return anything. How do I get the results?
What you mean ? It return none or what?
Like the program just finishes. Like you know when you write a function in a program, but you forget to actually run the function? Just like that, it doesn't return anything, it just ends the program.
Can you accept the answer and create new question ? As it is a different issue not related to this one

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.