- To get answers you can use
selenium
click methods or other libraries that can simulate clicks.
- Extract directly from Javascript:

- Using Google Related Questions API from SerpApi. It's a paid API with a free trial. Check playground.
Code and example:
from serpapi import GoogleSearch
import os
params = {
"engine": "google",
"q": "what is java",
"api_key": os.getenv("API_KEY"),
}
search = GoogleSearch(params)
results = search.get_dict()
for q_and_a in results['related_questions']:
print(f"Question: {q_and_a['question']}\nAnswer: {q_and_a['snippet']}\n")
Output:
Question: What is Java and why do I need it?
Answer: Java is a programming language and computing platform first released by Sun Microsystems in 1995. There are lots of applications and websites that will not work unless you have Java installed, and more are created every day. Java is fast, secure, and reliable.
Question: What is Java used for?
Answer: One of the most widely used programming languages, Java is used as the server-side language for most back-end development projects, including those involving big data and Android development. Java is also commonly used for desktop computing, other mobile computing, games, and numerical computing.Apr 12, 2019
Question: What is Java in simple words?
Answer: Java is a high-level programming language developed by Sun Microsystems. Instead, Java programs are interpreted by the Java Virtual Machine, or JVM, which runs on multiple platforms. ... This means all Java programs are multiplatform and can run on different platforms, including Macintosh, Windows, and Unix computers.Apr 19, 2012
Question: What is Java and its types?
Answer: The types of the Java programming language are divided into two categories: primitive types and reference types. The primitive types (§4.2) are the boolean type and the numeric types. The numeric types are the integral types byte , short , int , long , and char , and the floating-point types float and double .
Disclaimer, I work for SerpApi.