



from urllib.error import HTTPError

from bsa import BeautifulSoup
from requests import exceptions, get

a_								=   """https://www.wellrx.com/prescriptions/{0}/{1}/?freshSearch=true"""





def 						a__     (						_UpperCamelCase     :	str	,_UpperCamelCase     :	str							):

   try:
      # Has user provided both inputs?
      if not drug_name or not zip_code:
         return None

      __lowerCamelCase  							=      BASE_URL.format(_UpperCamelCase	,_UpperCamelCase							)
      __lowerCamelCase  							=      get(_UpperCamelCase							)

      # Is the response ok?
      response.raise_for_status()

      # Scrape the data using bs4
      __lowerCamelCase  							=      BeautifulSoup(response.text	,'''html.parser'''							)

      # This list will store the name and price.
      __lowerCamelCase  							=      []

      # Fetch all the grids that contains the items.
      __lowerCamelCase  							=      soup.find_all('''div'''	,{'''class''': '''grid-x pharmCard'''}							)
      if grid_list and len(_UpperCamelCase							) > 0:
         for grid in grid_list:
            # Get the pharmacy price.
            __lowerCamelCase  							=      grid.find('''p'''	,{'''class''': '''list-title'''}							).text

            # Get price of the drug.
            __lowerCamelCase  							=      grid.find('''span'''	,{'''p''', '''price price-large'''}							).text

            pharmacy_price_list.append(
                {
                    '''pharmacy_name''': pharmacy_name,
                    '''price''': price,
                }							)

      return pharmacy_price_list

   except (HTTPError, exceptions.RequestException, ValueError):
      return None


if __name__ == "__main__":
  # Enter a drug name and a zip code
  a_								=   input("""Enter drug name: """).strip()
  a_								=   input("""Enter zip code: """).strip()

  a_								=   fetch_pharmacy_and_price_list(
      drug_name, zip_code
  )

  if pharmacy_price_list:
    print(f"\nSearch results for {drug_name} at location {zip_code}:")
    for pharmacy_price in pharmacy_price_list:
      a_								=   pharmacy_price["""pharmacy_name"""]
      a_								=   pharmacy_price["""price"""]

      print(f"Pharmacy: {name} Price: {price}")
  else:
    print(f"No results found for {drug_name}")











def 						a__     (						_UpperCamelCase     :	list	,_UpperCamelCase     :	list	,_UpperCamelCase     :	list	,_UpperCamelCase     :	int	,_UpperCamelCase     :	int							):
   if target == 0:
      answer.append(path.copy()							)
   else:
      for index in range(_UpperCamelCase	,len(_UpperCamelCase							)							):
         if target >= candidates[index]:
            path.append(candidates[index]							)
            backtrack(_UpperCamelCase	,_UpperCamelCase	,_UpperCamelCase	,target - candidates[index]	,_UpperCamelCase							)
            path.pop(len(_UpperCamelCase							) - 1							)





def 						a__     (						_UpperCamelCase     :	list	,_UpperCamelCase     :	int							):
   __lowerCamelCase  							=      []  # type: list[int]
   __lowerCamelCase  							=      []  # type: list[int]
   backtrack(_UpperCamelCase	,_UpperCamelCase	,_UpperCamelCase	,_UpperCamelCase	,0							)
   return answer





def 						a__     (						):
   print(combination_sum([-8, 2.3, 0]	,1							)							)


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  main()






