






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

   print('Googling.....')

   A_		:		Optional[Any]		     =			F'''https://www.google.com/search?q={query}&num=100'''

   A_		:		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_		:		Optional[Any]		     =			parse_qs(
          BeautifulSoup(res.text, 'html.parser')
          .find('div', attrs={'class': 'kCrYT'})
          .find('a')
          .get('href')
      )['url'][0]

   webbrowser.open(link)







from abc import ABC, abstractmethod
from argparse import ArgumentParser




class     _lowerCAmelCase(	UpperCAmelCase_ ):





       """simple docstring"""







       @staticmethod
       @abstractmethod
       def       _a   ( _lowerCamelCase							):
         raise NotImplementedError()





       @abstractmethod
       def       _a   ( self							):
         raise NotImplementedError()