Classes
The following classes are available globally.
-
The browser used to perform the web scraping.
This class encapsulates the webview and its delegates, providing an closure based API.
See moreDeclaration
Swift
public class Browser : NSObject, WKNavigationDelegate, WKScriptMessageHandler
-
The
StepRunner
is the engine that runs the steps in the pipeline.Once initialized, call the
See morerun()
method to execute the steps, and observe thestate
property to be notified of progress and status.Declaration
Swift
public class StepRunner
-
Step that runs some script which will return a result asynchronously via
SwiftScraper.postMessage()
.The
See moreStepFlowResult
returned by thehandler
can be used to drive control flow of the steps.Declaration
Swift
public class AsyncScriptStep : ScriptStep
-
Step that downloads a file from a given URL and returns the contents
The
See moreStepFlowResult
returned by thehandler
can be used to drive control flow of the steps.Declaration
Swift
@available(iOS 14.5, macOS 11.3, *) public class DownloadStep : NSObject, Step
extension DownloadStep: WKDownloadDelegate
-
Step that runs some JavaScript which will return a result immediately from the JavaScript function.
The
See moreStepFlowResult
returned by thehandler
can be used to drive control flow of the steps.Declaration
Swift
public class ScriptStep : Step