Thanks for the reply. I did have those, but the old import seem to break the standard recipe.
The old code snippets I copied and pasted seemed to cause more issue for me.
I the code working now, and I have pasted it below.
I modified the
It grabs the latest paper front page for either The Guardian and The Observer.
Code:
import urllib2
from datetime import date, timedelta
from bs4 import BeautifulSoup
def twitter_front_page():
basedate = date.today() - timedelta(days=2)
baseurl = 'https://mobile.twitter.com/search?q=front%20page%20%20%28from%3Aobserveruk%20OR%20from%3Aguardian%29%20since%3A' + str(basedate)
data = urllib2.urlopen(baseurl)
html = BeautifulSoup(data, 'html.parser')
media = html.find(class_="media")
img = media.find('img')
twitter_cover = img.get('src')
return twitter_cover
cover_url = twitter_front_page()