


'''simple docstring'''
import webbrowser
from sys import argv
from urllib.parse import parse_qs, quote

import requests
from bsa import BeautifulSoup
from fake_useragent import UserAgent

if __name__ == "__main__":
    lowerCAmelCase						=					"""%20""".join(argv[1:]) if len(argv) > 1 else quote(str(input("""Search: """)))

    print("""Googling.....""")

    lowerCAmelCase						=					F'https://www.google.com/search?q={query}&num=100'

    lowerCAmelCase						=					requests.get(
        url,
        headers={"""User-Agent""": str(UserAgent().random)},
    )

    try:
        lowerCAmelCase						=					(
            BeautifulSoup(res.text, """html.parser""")
            .find("""div""", attrs={"""class""": """yuRUbf"""})
            .find("""a""")
            .get("""href""")
        )

    except AttributeError:
        lowerCAmelCase						=					parse_qs(
            BeautifulSoup(res.text, """html.parser""")
            .find("""div""", attrs={"""class""": """kCrYT"""})
            .find("""a""")
            .get("""href""")
        )["""url"""][0]

    webbrowser.open(link)









'''simple docstring'''
from __future__ import annotations

def 					lowerCamelCase_ ( __UpperCamelCase					:       list							,    __UpperCamelCase					:       int | None = None							,    __UpperCamelCase					:       int | None = None		)					->	None:







     """simple docstring"""
     if start is None:
          _A				=							0

     if end is None:
          _A				=							len(__UpperCamelCase		) - 1

     if start >= end:
          return

     _A				=							(start + end) // 2

     slowsort(__UpperCamelCase							,    __UpperCamelCase							,    __UpperCamelCase		)
     slowsort(__UpperCamelCase							,    mid + 1							,    __UpperCamelCase		)

     if sequence[end] < sequence[mid]:
          _A		,				_A				=							sequence[mid], sequence[end]

     slowsort(__UpperCamelCase							,    __UpperCamelCase							,    end - 1		)


if __name__ == "__main__":
    from doctest import testmod

    testmod()





