提取某个网页的所有图片,所有图片的父标签是不确定的,而需求是要排除<a>标签下的图片
<div style='background-color:#993300; text-align: center;'>
<div style='text-align: center;clear: both; padding:5px 0; display: inline-block;background-color:#993300'>
<table border="0" cellpadding="0" cellspacing="0"> <tbody><tr><td> <a href='http://www.aliexpress.com/item/anywhere/33051303647.html'><img style='margin: 1px; border: 0px currentColor; ' src='https://ae01.alicdn.com/kf/HTB16xF2eBGE3KVjSZFhq6AkaFXa6.jpg'></a></td><td> <a href='http://www.aliexpress.com/item/anywhere/33048238548.html'><img style='margin: 1px; border: 0px currentColor; ' src='https://ae01.alicdn.com/kf/HTB1YMhZewmH3KVjSZKzq6z2OXXaL.jpg'></a></td><td> <a href='http://www.aliexpress.com/item/anywhere/33044721080.html'><img style='margin: 1px; border: 0px currentColor; ' src='https://ae01.alicdn.com/kf/HTB1DhJ2eBGE3KVjSZFhq6AkaFXaY.jpg'></a></td><td> <a href='http://www.aliexpress.com/item/anywhere/33014377031.html'><img style='margin: 1px; border: 0px currentColor; ' src='https://ae01.alicdn.com/kf/HTB1qkl6eBGw3KVjSZFDq6xWEpXak.jpg'></a></td><td> <a href='http://www.aliexpress.com/item/anywhere/32990955163.html'><img style='margin: 1px; border: 0px currentColor; ' src='https://ae01.alicdn.com/kf/HTB1KQpZevWG3KVjSZFPq6xaiXXat.jpg'></a></td></tr><tr><td> <a href='http://www.aliexpress.com/item/anywhere/33026321971.html'><img style='margin: 1px; border: 0px currentColor; ' src='https://ae01.alicdn.com/kf/HTB1Kb85eBGw3KVjSZFwq6zQ2FXaa.jpg'></a></td><td> <a href='http://www.aliexpress.com/item/anywhere/33045517107.html'><img style='margin: 1px; border: 0px currentColor; ' src='https://ae01.alicdn.com/kf/HTB1oQB2eAWE3KVjSZSyq6xocXXa3.jpg'></a></td><td> <a href='http://www.aliexpress.com/item/anywhere/33003023746.html'><img style='margin: 1px; border: 0px currentColor; ' src='https://ae01.alicdn.com/kf/HTB14V01eB1D3KVjSZFyq6zuFpXaD.jpg'></a></td><td> <a href='http://www.aliexpress.com/item/anywhere/32990891682.html'><img style='margin: 1px; border: 0px currentColor; ' src='https://ae01.alicdn.com/kf/HTB1YcBZewaH3KVjSZFjq6AFWpXa1.jpg'></a></td><td> <a href='http://www.aliexpress.com/item/anywhere/33049126971.html'><img style='margin: 1px; border: 0px currentColor; ' src='https://ae01.alicdn.com/kf/HTB1y7J8eqWs3KVjSZFxq6yWUXXaV.jpg'></a></td></tr> </tbody></table>
</div>
<p> <img alt="PZH80705592_20180705025311897" src="https://ae01.alicdn.com/kf/HTB1kn6eMgHqK1RjSZFgq6y7JXXa0.jpg"><img alt="PZH80705592WHL_20180705025822366" src="https://ae01.alicdn.com/kf/HTB1.pLoMkvoK1RjSZFwq6AiCFXaR.jpg"><img alt="PZH80705592BUL_20180705025911250" src="https://ae01.alicdn.com/kf/HTB13KvBMhnaK1RjSZFBq6AW7VXaO.jpg"><img alt="PZH80705592BUL_20180705025911407" src="https://ae01.alicdn.com/kf/HTB1KrjcMbvpK1RjSZPiq6zmwXXaC.jpg"><img alt="PZH80705592BUL_20180705025912815" src="https://ae01.alicdn.com/kf/HTB16zHcMXYqK1RjSZLeq6zXppXaF.jpg"><img alt="PZH80705592WHL_2018070502294261" src="https://ae01.alicdn.com/kf/HTB1I1DBMhnaK1RjSZFBq6AW7VXa4.jpg"><img alt="PZH80705592WHL_20180705022942196" src="https://ae01.alicdn.com/kf/HTB1liYfMkvoK1RjSZFDq6xY3pXae.jpg"><img alt="PZH80705592WHL_20180705022942378" src="https://ae01.alicdn.com/kf/HTB1.pLoMkvoK1RjSZFwq6AiCFXaR.jpg"></p>
方法:
img_desc = response.xpath('//*[name(.)!="a"]/img/@src').extract() # 利用name()方法