opening google searches with python
<p>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 ?</p>

<pre><code>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)
</code></pre>

<p><strong>EDIT:</strong></p>

<pre><code>url = "https://www.google.com.tr/search?q={}".format(term)
webbrowser.open_new_tab(url)
</code></pre>

<p>to open new tab, but now could anyone tell me how to click first 5 results which I get from opening some google search
<strong>EDIT</strong>
so I figured a way out with lib called google</p>

<pre><code>for url in search('"search_term', stop=5):
</code></pre>

<p>also I just decided that I would close them all just with task kill because webbroser lib doesn't have close window command</p>