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

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

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

		__a    :	Optional[Any]         =    requests.get(
		    url,
		    headers={"""User-Agent""": str(UserAgent().random)},
		)

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

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

		webbrowser.open(link)
def 							UpperCAmelCase		(       lowercase				,     lowercase				):







				"""simple docstring"""



				__lowercase					     =				len(lowercase				)
				__lowercase					     =				len(lowercase				)
				__lowercase					     =				[[False for _ in range(m + 1				)] for _ in range(n + 1				)]
				__lowercase					     =				True
				for i in range(lowercase				):
								for j in range(m + 1				):
												if dp[i][j]:
																if j < m and a[i].upper() == b[j]:
																				__lowercase					     =				True
																if a[i].islower():
																				__lowercase					     =				True
				return dp[n][m]


if __name__ == "__main__":
		import doctest

		doctest.testmod()