I want to make my program open first 5 searches of google. Currently I have only simple google search generator which opens a search. Is there a way to open 5 searches into new tabs then close them ?
dict = readdict()
lenght = len(dict)
search_term=""
for _ in range(self.variable2.get()):
skc=randint(0,lenght)
word = dict[skc].split(',')
search_term+=word[0]+" "
url = "https://www.google.com.tr/search?q={}".format(search_term)
webbrowser.open(url)
EDIT:
url = "https://www.google.com.tr/search?q={}".format(term)
webbrowser.open_new_tab(url)
to open new tab, but now could anyone tell me how to click first 5 results which I get from opening some google search EDIT so I figured a way out with lib called google
for url in search('"search_term', stop=5):
also I just decided that I would close them all just with task kill because webbroser lib doesn't have close window command