if (page.indexOf(query) !== -1) page = page.substring(0, page.indexOf(query) + query.length - 1);