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

			print("Googling.....")

			__lowerCAmelCase    :							Any													=						F"https://www.google.com/search?q={query}&num=100"

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

			try:
						__lowerCAmelCase    :							Union[str, Any]													=						(
						    BeautifulSoup(res.text, "html.parser")
						    .find("div", attrs={"class": "yuRUbf"})
						    .find("a")
						    .get("href")
						)

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

			webbrowser.open(link)





"""simple docstring"""




import pprint

import requests

__lowerCAmelCase    :							Union[str, Any]													=						"https://zenquotes.io/api"







def 							_UpperCAmelCase		(       ):





		"""simple docstring"""




		return requests.get(API_ENDPOINT_URL + """/today"""     ).json()







def 							_UpperCAmelCase		(       ):





		"""simple docstring"""




		return requests.get(API_ENDPOINT_URL + """/random"""     ).json()


if __name__ == "__main__":
			__lowerCAmelCase    :							Union[str, Any]													=						random_quotes()
			pprint.pprint(response)




