Updated getPageHtml Function: The function is now equipped to discern between XPath and CSS selectors. It properly evaluates XPath expressions, addressing issues where the crawler previously failed to process XPath selectors.
XPath Handling in requestHandler: The request handler now contains logic to distinguish XPath selectors from CSS selectors. This addition ensures the crawler appropriately waits for and handles elements located via XPath.
waitForXPath Function: A new function that waits specifically for XPath elements, improving the crawler's robustness and its ability to handle dynamic content loaded via JavaScript.
Updated getPageHtml Function: The function is now equipped to discern between XPath and CSS selectors. It properly evaluates XPath expressions, addressing issues where the crawler previously failed to process XPath selectors.
XPath Handling in requestHandler: The request handler now contains logic to distinguish XPath selectors from CSS selectors. This addition ensures the crawler appropriately waits for and handles elements located via XPath.
waitForXPath Function: A new function that waits specifically for XPath elements, improving the crawler's robustness and its ability to handle dynamic content loaded via JavaScript.