Finding solutions on GitHub and Stack Overflow The first part of the code opens Chrome and navigates to GitHub. If I don't find my solution, I open a new tab with ctrlt. Then my code goes to Stack Overflow and searches there for solutions.
from selenium import webdriver
from selenium.webdriver.common.keys import *
import time
import keyboard

q = input(&quot;what is your programming question : &quot;)+(' python')
class github :
    path = &quot;c:/users/admin/appdata/local/programs/python/python38-32/chromedriver.exe&quot;
    driver = webdriver.Chrome(path)

    driver.get(&quot;https://github.com/&quot;)
    question = driver.find_element_by_name(&quot;q&quot;)
    time.sleep(3)


    question.send_keys(q)
    question.send_keys(Keys.RETURN)

    while True:
        if keyboard.is_pressed(&quot;ctrl+t&quot;):
            driver.switch_to_window(driver.window_handles[-1])
            driver.get(&quot;https://stackoverflow.com/&quot;)
            question_2 = driver.find_element_by_name(&quot;q&quot;)

            question_2.send_keys(q)
            question_2.send_keys(Keys.RETURN)
            break
Selenium
Selenium imposes a lot of overhead and complexity that you don't need to deal with. If you needed to scrape, use requests + beautifulsoup; but you don't: StackExchange has a good API, so you should strongly prefer using that. It will get you results more efficiently and the results will be more accurate and less fragile.
PEP8
class github :

should be
class Github: