Re: beautiful soup get class info

2014-03-12 Thread Peter Otten
Christopher Welborn wrote: > On 03/06/2014 02:22 PM, teddyb...@gmail.com wrote: >> 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 th

Re: beautiful soup get class info

2014-03-11 Thread Christopher Welborn
On 03/06/2014 02:22 PM, teddyb...@gmail.com wrote: 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=

Re: beautiful soup get class info

2014-03-06 Thread Mark Lawrence
On 07/03/2014 01:37, teddyb...@gmail.com wrote: 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 ima

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

Re: beautiful soup get class info

2014-03-06 Thread John Gordon
In teddyb...@gmail.com 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 a workaround for that. > Now when I take out [ class="date"], this is retur

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 John Gordon
In teddyb...@gmail.com 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 Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House', or a real se

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,