I am trying to return only the director text within this query from an imdb page: https://www.imdb.com/title/tt0126886/
From the following html:
<div class="plot_summary ">
<div class="summary_text ready"><div class="localized-plot "><div class="plot-text"><div class="ipc-html-content ipc-html-content--base"><div>
A high school teacher's personal life becomes complicated as he works with students during the school elections, particularly with an obsessive overachiever determined to become student body president.
</div></div></div><div class="locale-select"><div class="locale-label"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" class="ipc-icon ipc-icon--language" viewBox="0 0 24 24" fill="currentColor" role="presentation"><path fill="none" d="M0 0h24v24H0V0z"></path><path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2s.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2s.07-1.35.16-2h4.68c.09.65.16 1.32.16 2s-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2s-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"></path></svg> EN<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" class="ipc-icon ipc-icon--arrow-drop-down" viewBox="0 0 24 24" fill="currentColor" role="presentation"><path fill="none" d="M0 0h24v24H0V0z"></path><path d="M8.71 11.71l2.59 2.59c.39.39 1.02.39 1.41 0l2.59-2.59c.63-.63.18-1.71-.71-1.71H9.41c-.89 0-1.33 1.08-.7 1.71z"></path></svg></div></div></div></div>
<div class="credit_summary_item">
<h4 class="inline">Director:</h4>
<a href="/name/nm0668247/?ref_=tt_ov_dr">Alexander Payne</a> </div>
<div class="credit_summary_item">
<h4 class="inline">Writers:</h4>
<a href="/name/nm0674909/?ref_=tt_ov_wr">Tom Perrotta</a> (novel), <a href="/name/nm0668247/?ref_=tt_ov_wr">Alexander Payne</a> (screenplay) <span class="ghost">|</span>
<a href="fullcredits?ref_=tt_ov_wr#writers/">1 more credit</a> »
</div>
<div class="credit_summary_item">
<h4 class="inline">Stars:</h4>
<a href="/name/nm0000111/?ref_=tt_ov_st_sm">Matthew Broderick</a>, <a href="/name/nm0000702/?ref_=tt_ov_st_sm">Reese Witherspoon</a>, <a href="/name/nm0005098/?ref_=tt_ov_st_sm">Chris Klein</a> <span class="ghost">|</span>
<a href="fullcredits/?ref_=tt_ov_st_sm">See full cast & crew</a> »
</div>
</div>
My XPATH Query:
"//div[@class='credit_summary_item']/a[1]"
Result of my query:
Alexander Payne
Tom Perrotta
Matthew Broderick
Result I am looking for: Alexander Payne
How do I return only the first result when considering each of these items have the same class attribute "credit_summary_item"?