Xpath selection 没有 select url

Xpath selection doesn't select url

我想获取所有本身包含 mediaid 的 href 链接。通常,我使用的 xpath 有效,但在这种情况下无效。我错过了什么?

感谢您的宝贵时间。

DIV:

<div class="download"><span class="downloads">25746</span><a href="/download/?type=1&mediaid=205234">Skini titl</a></div>

URL: https://titlovi.com/titlovi/?prijevod=cobbler&jezik=hrvatski|cirilica|srpski&t=1&g=2014&sort=9

Xpath

//a[contains(@href,"mediaid")]

由于服务器发送的实际源不包含预期的 html,但确实包含这些 html-fragments:

  <div class="download">
    <span class="downloads">25749</span>
    <a href="/titlovi/the-cobbler-205234/">Skini titl</a>
  </div>

您可以使用以下 XPath:

//div[@class="download"]/a