a copy of queryIndexPage.py using pure lxml