input: Write a python function to scrape book titles, authors, and publication dates from an Amazon page and save them to a text file.
  assert scrape_books('https://www.amazon.com/books-used-books-textbooks/b/ref=sv_b_5?ie=UTF8&node=283155') == True
output: def scrape_books(url):
      import requests
      from bs4 import BeautifulSoup
  
      headers = {
          "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3"}
  
      response = requests.get(url, headers=headers)
      if response.status_code != 200:
          return False
  
      soup = BeautifulSoup(response.content, 'html.parser')
      books = soup.find_all('div', {'class': 's-result-item'})
  
      with open('books.txt', 'w', encoding='utf-8') as f:
          for book in books:
              title = book.find('span', {'class': 'a-size-medium'})
              author = book.find('a', {'class': 'a-size-base a-link-normal'})
              pub_date = book.find('span', {'class': 'a-size-base a-color-secondary a-text-normal'})
  
              if title and author and pub_date:
                  f.write(f"Title: {title.get_text().strip()}\n")
                  f.write(f"Author: {author.get_text().strip()}\n")
                  f.write(f"Publication Date: {pub_date.get_text().strip()}\n\n")
  
      return True