4
In [12]: s = 'http://www.nyse.com/about/listed/lcddata.html?ticker=abt">ABT | '
In [13]: import BeautifulSoup
In [14]: bs=BeautifulSoup.BeautifulSoup(s)
In [15]: bs.a.contents
Out[15]: [u'ABT']
【在 w*s 的大作中提到】
: for a line like this, how to get ABT ?
: http://www.nyse.com/about/listed/lcddata.html?ticker=abt">ABT | : i did this, not working,
: matchObj = re.search(r"
* | ", eachLine)
:
: if matchObj:
: print matchObj.group(3)
: Many thanks !