

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

     print("Googling.....")

     _lowerCamelCase    :       Union[str, Any]        =							f"""https://www.google.com/search?q={query}&num=100"""

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

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

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

     webbrowser.open(link)








def       a__					(		UpperCAmelCase							:      int    ,			UpperCAmelCase							:      int      )  ->						str:
  if a < 0 or b < 0:
    raise ValueError('''the value of both inputs must be positive'''      )
  UpperCAmelCase	:							List[Any]						=			str(bin(UpperCAmelCase      )      )[2:]  # remove the leading "0b"
  UpperCAmelCase	:							List[str]						=			str(bin(UpperCAmelCase      )      )[2:]
  UpperCAmelCase	:							Optional[Any]						=			max(len(UpperCAmelCase      )    ,			len(UpperCAmelCase      )      )
  return "0b" + "".join(
      str(int('''1''' in (char_a, char_b)      )      )
      for char_a, char_b in zip(a_binary.zfill(UpperCAmelCase      )    ,			b_binary.zfill(UpperCAmelCase      )      )      )


if __name__ == "__main__":
     import doctest

     doctest.testmod()





