Visual Selector - be more resilient when sites interfere with the xPath scraping

pull/645/head
dgtlmoon 3 years ago
parent eef56e52c6
commit 7983675325

@ -89,14 +89,22 @@ class Fetcher():
xpath_result =d; xpath_result =d;
} }
} catch (e) { } catch (e) {
var x=1; console.log(e);
} }
// You could swap it and default to getXpath and then try the smarter one // You could swap it and default to getXpath and then try the smarter one
// default back to the less intelligent one // default back to the less intelligent one
if (!xpath_result) { if (!xpath_result) {
try {
// I've seen on FB and eBay that this doesnt work
// ReferenceError: getXPath is not defined at eval (eval at evaluate (:152:29), <anonymous>:67:20) at UtilityScript.evaluate (<anonymous>:159:18) at UtilityScript.<anonymous> (<anonymous>:1:44)
xpath_result = getXPath(elements[i]); xpath_result = getXPath(elements[i]);
} catch (e) {
console.log(e);
continue;
} }
}
if(window.getComputedStyle(elements[i]).visibility === "hidden") { if(window.getComputedStyle(elements[i]).visibility === "hidden") {
continue; continue;
} }

Loading…
Cancel
Save