I would like to get all href links that contain mediaid in itself. Usually, the xpath I am using works, but not in this case. What am I missing?
Thanks for your time.
DIV:
<div ><span >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")]
CodePudding user response:
Since the actual source send by the server does not contain the expected html, but does contains these html-fragments:
<div >
<span >25749</span>
<a href="/titlovi/the-cobbler-205234/">Skini titl</a>
</div>
you could use the following XPath:
//div[@]/a