I am trying to extract links and titles for these links in an anime website, However, I am only able to extract the whole tag, I just want the href and the title.
Here`s the code am using:
import requests
from bs4 import BeautifulSoup
r = requests.get('http://animeonline.vip/info/phi-brain-kami-puzzle-3')
soup = BeautifulSoup(r.content, "html.parser")
for link in soup.find_all('div', class_='list_episode'):
href = link.get('href')
print(href)
And here`s the website html:
<a href="http://animeonline.vip/phi-brain-kami-puzzle-3-episode-25" title="Phi Brain: Kami no Puzzle 3 episode 25">
Phi Brain: Kami no Puzzle 3 episode 25 <span> 26-03-2014</span>
</a>
And this is the output:
C:\Python34\python.exe C:/Users/M.Murad/PycharmProjects/untitled/Webcrawler.py
None
Process finished with exit code 0
All that I want is all links and titles in that class (episodes and their links)
Thanks.