Skip to content
forked from zntfdr/Selenops

A Swift Web Crawler 🕷

License

Notifications You must be signed in to change notification settings

kenloo/Selenops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Selenops

Selenops logo
Swift Package Manager MacOS + iOS + iPadOS + tvOS + watchOS Twitter: @zntfdr

Welcome to Selenops, a Swift Web Crawler.

Given a webpage url and a word to search, Selenops will look for said word in that page, and all pages linked in there, recursively.

Usage

Create an object that conforms to CrawlerDelegate:

import Selenops

// Initialize crawler.
let crawler = Crawler(
  startURL: URL(string: "https://fivestars.blog/")!,
  maximumPagesToVisit: 10,
  wordToSearch: "Swift"
)

// Set delegate.
crawler.delegate = ... // Needs to conform to CrawlerDelegate

// Start crawling!
crawler.start()

Installation

Selenops is distributed via the Swift Package Manager:

  • to use it into an app, follow this tutorial and use this repository URL: https://github.com/zntfdr/Selenops.git.

  • to use it in a package, add it as a dependency in your Package.swift:

 let package = Package(
     ...
     dependencies: [
         .package(url: "https://github.com/zntfdr/Selenops.git", from: "2.0.0")
     ],
     targets: [
        .target(
            ...
            dependencies: ["Selenops"])
     ],
     ...
 )

...and then use import Selenops whenever necessary.

Command line tool

Swift Web Crawler in action

Selenops also comes with a command line tool that showcases its functionality.

To install it, clone the project and run make:

$ git clone https://github.com/zntfdr/Selenops.git
$ cd Selenops
$ make

Credits

Selenops was built by Federico Zanetello as an example of a Swift script.

Contributions and Support

All users are welcome and encouraged to become active participants in the project continued development — by fixing any bug that they encounter, or by improving the documentation wherever it’s found to be lacking.

If you'd like to make a change, please open a Pull Request, even if it just contains a draft of the changes you’re planning, or a test that reproduces an issue.

Thank you and please enjoy using Selenops!

About

A Swift Web Crawler 🕷

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 98.9%
  • Makefile 1.1%