from bs4 import BeautifulSoup
from urllib.request import urlopen

URL = "http://and.medianewsonline.com/hello.html"
html = urlopen(URL).read()
soup = BeautifulSoup(html)
arts = soup.find_all('div', class_='articleHeader')

for art in arts:
    name = art.contents[0].string.strip()
    print(name)
    artbody = art.find_next_sibling('div', class_='article enArticle')
    titlenode = artbody.find_next('div', id='hd')
    title = titlenode.get_text().strip()
    print("Title: {0}".format(title))
    srcnode = titlenode.find_next('a')
    while srcnode.parent.get('class') == ['author']:
        srcnode=srcnode.find_next('a')
    source = srcnode.string
    srcnode = srcnode.parent
    date = srcnode.find_previous_sibling('div').string
    print("Date: {0}".format(date))
    print("Source: {0}".format(source))
    cont = srcnode.find_next_siblings('p', class_='articleParagraph enarticleParagraph')
    contents = '\n'.join([c.get_text() for c in cont])
    print("Contents: {0}".format(contents))

    
