






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__":
							UpperCamelCase								=		"%20".join(argv[1:]) if len(argv) > 1 else quote(str(input("Search: ")))

							print("Googling.....")

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

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

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

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

							webbrowser.open(link)











'''simple docstring'''




import math
import sys






def 			_lowerCAmelCase     (    __snake_case    :					int     )	->	int:
     if number != int(__snake_case     ):
          raise ValueError('the value of input must be a natural number'     )
     if number < 0:
          raise ValueError('the value of input must not be a negative number'     )
     if number == 0:
          return 1
     __A		:					str						=			[-1] * (number + 1)
     __A		:					Dict						=			0
     for i in range(1					,				number + 1     ):
          __A		:					int						=			sys.maxsize
          __A		:					int						=			int(math.sqrt(__snake_case     )     )
          for j in range(1					,				root + 1     ):
               __A		:					str						=			1 + answers[i - (j**2)]
               __A		:					Dict						=			min(__snake_case					,				__snake_case     )
          __A		:					Union[str, Any]						=			answer
     return answers[number]


if __name__ == "__main__":
  import doctest

  doctest.testmod()