0

I'm trying to get the information in the Google banner after a search. I explain myself in more detail, what I'm trying to get is not the first links or description of Google, but the Google banner that gives you direct access to information.

Example: you type "PSG Team" in the search bar, Google will display the current team directly without having to navigate to another site.

I am currently using the Google-Search-API python module but can not retrieve the banner containing the necessary information.

Here is my code:

from google import google

num_page = 1
search_results = google.search("psg team", num_page)
for result in search_results:
     print (result.banner) #banner propriety doesn't exist but this is what I want

Thank you!

Paktros
  • 72
  • 1
  • 7

1 Answers1

0

The functionality that you are describing is not part of the google search API. That is only Google's custom addition on their search UI.

To do what you want, you would have to use a screen scraper with a headless browser like PhantomJS to ensure that any JS code is executed before you retrieve the results.

Here's an example of how this could be done in python: Is there a way to use PhantomJS in Python?

Community
  • 1
  • 1
swbandit
  • 1,986
  • 1
  • 26
  • 37