So I want to scrape the Director from this. But as I have seen the page I know there are two directors for this particular movie Danny Boyle and Loveleen Tandan. But there is no way to get it if I use find_all('a') then It will also take the name of actors like Dev Patel, Freida Pinto.
I can't use find_all('a')[1] and find_all('a')[2] because for other movies there could be only one directors. The only thing seperating actors from director is span tag with class ghost. How should I scrape this data, assuming there could be one, two or three directors.
<p class="">
Directors:
<a href="/name/nm0000965/">
Danny Boyle
</a>
,
<a href="/name/nm0849164/">
Loveleen Tandan
</a>
<span class="ghost">
|
</span>
Stars:
<a href="/name/nm2353862/">
Dev Patel
</a>
,
<a href="/name/nm2951768/">
Freida Pinto
</a>
,
<a href="/name/nm0795661/">
Saurabh Shukla
</a>
,
<a href="/name/nm0438463/">
Anil Kapoor
</a>
</p>
The url of the page is : https://www.imdb.com/search/title/?count=100&groups=oscar_best_picture_winners&sort=year%2Cdesc&ref_=nv_ch_osc