input: Write a function to scrape photos and captions from a given website. The function should take a URL as input and print out the source link of each photo along with its caption if available. If no caption is available, it should print 'No caption'. If the URL is empty, the function should print 'No URL provided'.
  assert scrape_photos_and_captions('https://example.com/webpage')
  assert scrape_photos_and_captions('')=='No URL provided'
  assert scrape_photos_and_captions('https://nonexistentwebsite.com')
  assert scrape_photos_and_captions('https://example.com/nocaptions')
  assert scrape_photos_and_captions('https://example.com/emptydivs')
  assert scrape_photos_and_captions('https://example.com/webpage')
  assert scrape_photos_and_captions('https://example.com/webpage')
output: 
  def scrape_photos_and_captions(url):
      if not url:
          print('No URL provided')
          return
      
      try:
          import requests
          from bs4 import BeautifulSoup
          
          response = requests.get(url)
          response.raise_for_status()
          
          soup = BeautifulSoup(response.text, 'html.parser')
          photos = soup.find_all('img')
          
          for photo in photos:
              src = photo.get('src')
              caption = photo.find_next('figcaption')
              if caption:
                  print(f"Photo source: {src}, Caption: {caption.text}")
              else:
                  print(f"Photo source: {src}, Caption: No caption")
      except requests.exceptions.RequestException:
          print('Failed to retrieve the webpage')
  