Build a Python script that scrapes a website for news articles, extracts relevant information (title, author, date, content), and stores the extracted data into a SQLite database.
PLAINFORMAT
import requests
from bs4 import BeautifulSoup
import sqlite3

def scrape_website(url):
    response = requests.get(url)
    soup = BeautifulSoup(response.text, 'html.parser')
    
    # Find relevant tags containing article information
    articles = soup.find_all('div', class_='article')  # Modify this according to the website structure
    
    scraped_data = []
    
    for article in articles:
        title = article.find('h2').text.strip()
        author = article.find('span', class_='author').text.strip()
        date = article.find('time')['datetime']
        content = article.find('p').text.strip()
        
        scraped_data.append((title, author, date, content))
    
    return scraped_data

def store_data_in_db(data):
    conn = sqlite3.connect('news_articles.db')
    c = conn.cursor()

    c.execute('''CREATE TABLE IF NOT EXISTS articles
                 (title TEXT, author TEXT, date TEXT, content TEXT)''')

    c.executemany('INSERT INTO articles VALUES (?, ?, ?, ?)', data)

    conn.commit()
    conn.close()

url = 'https://example.com/news'  # Replace with the actual URL of the website you want to scrape
scraped_data = scrape_website(url)
store_data_in_db(scraped_data)