Fetcher + VisualSelector - xPath filter with attribute filter was breaking the element finder

pull/1234/head
dgtlmoon 2 years ago committed by GitHub
parent b76148a0f4
commit e970fef991
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -174,9 +174,22 @@ if (include_filters.length) {
} }
if (q) { if (q) {
// #1231 - IN the case XPath attribute filter is applied, we will have to traverse up and find the element.
if (q.hasOwnProperty('getBoundingClientRect')) {
bbox = q.getBoundingClientRect(); bbox = q.getBoundingClientRect();
console.log("xpath_element_scraper: Got filter element, scroll from top was " + scroll_y) console.log("xpath_element_scraper: Got filter element, scroll from top was " + scroll_y)
} else { } else {
try {
// Try and see we can find its ownerElement
bbox = q.ownerElement.getBoundingClientRect();
console.log("xpath_element_scraper: Got filter by ownerElement element, scroll from top was " + scroll_y)
} catch (e) {
console.log("xpath_element_scraper: error looking up ownerElement")
}
}
}
if(!q) {
console.log("xpath_element_scraper: filter element " + f + " was not found"); console.log("xpath_element_scraper: filter element " + f + " was not found");
} }

Loading…
Cancel
Save