Re: Need Help with the BeautifulSoup problem, please

2013-12-16 Thread Peter Otten
seasp...@gmail.com wrote: > I need to replace all tag with after ■. But the result from > below is '■ D / ' > Can you explain what I did wrong, please. > > s = '■A B C D / ' > soup = BeautifulSoup(s) > for i in soup.find_all(text='■'): > tag = soup.new_tag('span')

Re: Need Help with the BeautifulSoup problem, please

2013-12-16 Thread seaspeak
8 Dihedral於 2013年12月16日星期一UTC+8下午4時02分42秒寫道: > On Monday, December 16, 2013 2:41:08 PM UTC+8, seas...@gmail.com wrote: > > > I need to replace all tag with after ■. But the result from > > below is '■ D / ' > > > > > > Can you explain what I did wrong, please. > > > > > > > > > >

Re: Need Help with the BeautifulSoup problem, please

2013-12-16 Thread Andreas Perstinger
On 16.12.2013 07:41, seasp...@gmail.com wrote: I need to replace all tag with after ■. But the result frombelow is '■ D / ' Can you explain what I did wrong, please. s = '■A B C D / ' soup = BeautifulSoup(s) for i in soup.find_all(text='■'): tag = soup.new_tag('span')

Re: Need Help with the BeautifulSoup problem, please

2013-12-16 Thread seaspeak
seas...@gmail.com於 2013年12月16日星期一UTC+8下午2時41分08秒寫道: > I need to replace all tag with after ■. But the result from below > is '■ D / ' > > Can you explain what I did wrong, please. > > > > s = '■A B C D / ' > > soup = BeautifulSoup(s) > > for i in soup.find_all(text='■'): > >

Re: Need Help with the BeautifulSoup problem, please

2013-12-16 Thread 88888 Dihedral
On Monday, December 16, 2013 2:41:08 PM UTC+8, seas...@gmail.com wrote: > I need to replace all tag with after ■. But the result from below > is '■ D / ' > > Can you explain what I did wrong, please. > > > > s = '■A B C D / ' > > soup = BeautifulSoup(s) > > for i in soup.find

Need Help with the BeautifulSoup problem, please

2013-12-15 Thread seaspeak
I need to replace all tag with after ■. But the result from below is '■ D / ' Can you explain what I did wrong, please. s = '■A B C D / ' soup = BeautifulSoup(s) for i in soup.find_all(text='■'): tag = soup.new_tag('span') tag['style'] = 'REPLACE' for i