Why can't my xpath match?

<div class="img"><a target="_blank" href="http://news.pedaily.cn/201806/432662.shtml"><img src="https://img.codeshelper.com/upload/img/2021/03/21/licwgiwrvt211590.png"  data-src="https://pic2.pedaily.cn/default/scenery2/other/306330.jpg"  alt="6618:"></a></div>
<h3><a href="http://news.pedaily.cn/201806/432662.shtml" target="_blank">6618:</a></h3>
<div class="tag"><span class="date">2018-06-21 10:10</span>
<a href="http://www.pedaily.cn/tag/235880/" target="_blank">618</a><a href="http://www.pedaily.cn/tag/190820/" target="_blank"></a><a href="http://www.pedaily.cn/tag/82753/" target="_blank"></a>
</div>
</li><li data-special="553,1082" data-channleid="210" data-industryid="1">
<div class="img"><a target="_blank" href="http://news.pedaily.cn/201806/432643.shtml"><img src="https://img.codeshelper.com/upload/img/2021/03/21/licwgiwrvt211590.png"  data-src="https://pic2.pedaily.cn/default/scenery2/other/306482.jpg"  alt=""></a></div>
<h3><a href="http://news.pedaily.cn/201806/432643.shtml" target="_blank"></a></h3>
<div class="tag"><span class="date">2018-06-20 18:47</span>
<a href="http://www.pedaily.cn/tag/235864/" target="_blank"></a><a href="http://www.pedaily.cn/tag/101925/" target="_blank"></a><a href="http://www.pedaily.cn/tag/15940/" target="_blank"></a><a href="http://www.pedaily.cn/tag/210892/" target="_blank"></a>
</div>
</li><!--PE-Slice:3454-end-->
                                          <!--PE-Slice:6123-start--><li data-special="553,112,835" data-channleid="4219" data-industryid="0">
<div class="img"><a target="_blank" href="http://news.newseed.cn/p/1347954"><img src="https://img.codeshelper.com/upload/img/2021/03/21/licwgiwrvt211590.png"  data-src="https://pic2.pedaily.cn/18/201806/20180620@338442.jpg"  alt="90"" :"></a></div>
<h3><a href="http://news.newseed.cn/p/1347954" target="_blank">90"" :</a></h3>
<div class="tag"><span class="date">2018-06-20 16:54</span>

xpath:

  title_list=etree.HTML(response.content.decode("utf-8")).xpath("//div[@class="img"]/a[contains(@target,"_blank")]/@alt")
Mar.21,2021

all properties named alt should be selected using / @ alt .
change to:

  Python crawler Xpath syntax and usage of the lxml library  

Menu