beautiful soup get class info

2014-03-06 Thread teddybubu
I am using beautifulsoup to get the title and date of the website. title is working fine but I am not able to pull the date. Here is the code in the url: October 22, 2011 In Python, I am using the following code: date1 = soup.span.text data=soup.find_all(date="value") Results in: [] March 5,

Re: beautiful soup get class info

2014-03-06 Thread teddybubu
On Thursday, March 6, 2014 2:58:12 PM UTC-6, John Gordon wrote: > In teddy writes: > > > > > October 22, 2011 > > > > > date1 = soup.span.text > > > data=soup.find_all(date="value") > > > > Try this: > > > > soup.find_all(name="span", class="date") > > > > -- > > John Gordon

Re: beautiful soup get class info

2014-03-06 Thread teddybubu
On Thursday, March 6, 2014 4:28:06 PM UTC-6, John Gordon wrote: > In writes: > > > > > > soup.find_all(name="span", class="date") > > > > > I have python 2.7.2 and it does not like class in the code you provided. > > > > Oh right, 'class' is a reserved word. I imagine beautifulsoup has

extract from json

2014-03-07 Thread teddybubu
I can't find any example on how to do this. I have a json file like so: {"bostock":[{"url":"http://bl.ocks.org/mbostock/9360565","title":"titleplaceholder","date":"dateplaceholder"}, {"url":"http://bl.ocks.org/mbostock/9265674","title":"titleplaceholder","date":"dateplaceholder"}, {"url":"http://bl

Re: extract from json

2014-03-07 Thread teddybubu
On Friday, March 7, 2014 3:05:15 PM UTC-6, Kev Dwyer wrote: > wrote: > > I can't find any example on how to do this. > > > I have a json file like so: > > > {"bostock":[{"url":"http://bl.ocks.org/mbostock/9360565","title":"titleplaceholder","date":"dateplaceholder"},{"url":"http://bl.ocks.org/mb

help with for loop----python 2.7.2

2014-03-22 Thread teddybubu
I am trying to get all the element data from the rss below. The only thing I am pulling is the first element. I don't understand why the for loop does not go through the entire rss. Here is my code try: from urllib2 import urlopen except ImportError: from urllib.request import urlopen