문제

I have this piece of html:

<a href="http://francetv.fr/videos/alcaline_l_instant_,12163184.html"  class="ss-titre">
                                "Paris Combo"                   </a>    
<a href="http://francetv.fr/videos/jt20h_,12185324.html" class="ss-titre"> 
                            Journal         </a>

I can get http://francetv.fr/videos/jt20h_,12185324.html (example, not the real adress) but now, I would like, using beautifulsoup, to get "Paris Combo", and "Journal". I tried this:

for line in soup.findAll('/a'):
              title = line.get('</a>')

How can I do? Thanks

도움이 되었습니까?

해결책

You need to call find_all("a") instead.

>>> for line in soup.find_all("a"):
...     print(line.text.strip())
"Paris Combo"
Journal
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top