Q:

Finding the link of last table list using xpath (python)

<div id="js-map-search-result-nav" class="lookup-result-guide" style="width: 630px;">
<ul class="c-pagination lookup-result-pagination">
    <li class="c-pagination__list">
      <a href="/en/tokyo/rstLst/57/" class="c-pagination__target c-pagination__target--prev js-pjax-anchor" rel="prev">«&nbsp;Prev</a>
    </li>
  <li class="c-pagination__list"><a class="c-pagination__target c-pagination__target--num js-pjax-anchor" href="/en/tokyo/rstLst/54/">54</a></li> <li class="c-pagination__list"><a class="c-pagination__target c-pagination__target--num js-pjax-anchor" href="/en/tokyo/rstLst/55/">55</a></li> <li class="c-pagination__list"><a class="c-pagination__target c-pagination__target--num js-pjax-anchor" href="/en/tokyo/rstLst/56/">56</a></li> <li class="c-pagination__list"><a class="c-pagination__target c-pagination__target--num js-pjax-anchor" href="/en/tokyo/rstLst/57/">57</a></li> <li class="c-pagination__list"><span class="c-pagination__target c-pagination__target--num is-selected">58</span></li> <li class="c-pagination__list"><a class="c-pagination__target c-pagination__target--num js-pjax-anchor" href="/en/tokyo/rstLst/59/">59</a></li> <li class="c-pagination__list"><a class="c-pagination__target c-pagination__target--num js-pjax-anchor" href="/en/tokyo/rstLst/60/">60</a></li>   
    <li class="c-pagination__list">
      <a href="/en/tokyo/rstLst/59/" class="c-pagination__target c-pagination__target--next js-pjax-anchor" rel="next">Next &nbsp;»</a>
    </li>
</ul>

    1141 – 1160 of 131715  

I want to know how to get the xpath to get the link of last li tag no matter using response.css or response.xpath
This is the code that I am writing
for href in response.xpath('//*[@id="js-map-search-result-nav"]/ul/li[-1]/a/@href'):
    yield response.follow(href, self.parse)

A:

(//ul[contains(@class,'lookup-result-pagination')]/li)[last()]

or

(//ul[contains(@class,'c-pagination')]/li)[last()]

get last li element inside //ul[contains(@class,'lookup-result-pagination')]
and here is css locator:

ul.c-pagination>li:last-child

but last li - is "Next" button in your case, do you need it, or last page number? 
In that case you can use Xpath that checks that last li has no Next text

(//ul[contains(@class,'c-pagination')]/li[not(./a[contains(text(),'Next')])])[last()]

