lables = ['nvbfge','cvbfg','nfsd','jklibn','dfgrt','muyh','ytug','nghmdf','gfhasfecxv']for lable in lables: print(lable) urls_0 = response.xpath("//map[@name=$val]/area/@href",val=lable).extract() print(urls_0)