python - pyspider 如何获取某个列表中的第n个元素
黄舟
黄舟 2017-04-18 10:31:15
0
2
511
黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all (2)
PHPzhong
response.doc('.link_nei>ul>li>a').eq(-2).items()

Refer to the pyquery documentation https://pythonhosted.org/pyqu...

    洪涛

    I see you are using a CSS selector, just add:nth-last-child(2)after a.

    CSS selector tutorial: http://www.w3school.com.cn/cs...

      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!