Browser
public class Browser : NSObject, WKNavigationDelegate, WKScriptMessageHandler
The browser used to perform the web scraping.
This class encapsulates the webview and its delegates, providing an closure based API.
-
The webview itself
Declaration
Swift
public private(set) var webView: WKWebView! { get }
-
Tells the delegate that navigation is complete.
Declaration
Swift
public func webView(_: WKWebView, didFinish _: WKNavigation!)Parameters
webViewThe web view that loaded the content.
navigationThe navigation object that finished.
-
Tells the delegate that an error occurred during the early navigation process.
Declaration
Swift
public func webView( _: WKWebView, didFailProvisionalNavigation _: WKNavigation!, withError error: Error )Parameters
webViewThe web view that called the delegate method.
navigationThe navigation object for the operation. This object corresponds to a WKNavigation object that WebKit returned when the load operation began. You use it to track the progress of that operation.
errorThe error that occurred.
-
Tells the delegate that an error occurred during navigation.
Declaration
Swift
public func webView(_: WKWebView, didFail _: WKNavigation!, withError error: Error)Parameters
webViewThe web view that reported the error.
navigationThe navigation object for the operation. This object corresponds to a WKNavigation object that WebKit returned when the load operation began. You use it to track the progress of that operation.
errorThe error that occurred.
-
Tells the handler that a webpage sent a script message.
Declaration
Swift
public func userContentController( _: WKUserContentController, didReceive message: WKScriptMessage )Parameters
userContentControllerThe user content controller that delivered the message to your handler.
messageAn object that contains the message details.
View on GitHub
Install in Dash