Reputation: 110257
I have the following html:
<span class="episode">Episode: <a href="/title/tt2071912/">
!Que ve el Bisbe!</a>
(2011)
</span>
How would I get the year from this? When I get the episode object, it only gives me the 'text' before the <a>
:
result.cssselect('.episode')[0].text
'Episode: '
The best I have so far is:
year = lxml.html.tostring(result.cssselect('.episode')[0]).split('(')[-1].split(')')[0]
Upvotes: 0
Views: 93