You need to call find_all("a")
instead.
>>> for line in soup.find_all("a"):
... print(line.text.strip())
"Paris Combo"
Journal
문제
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