Latest 0.0.2
Homepage https://github.com/julianshen/SwSelect
License MIT
Platforms ios 8.0, osx 10.9, requires ARC
Authors

Build Status
Carthage Compatible
CocoaPods
License

The Swift framework provides similar selector implementation to jQuery. It could be used for parsing HTML easily with jQuery style queries. Currently, it supports only tag queries but no content manipulations. Most codes are ported from an Golang project called "Cascadia".

Installation

Add this to your carthage file:
github "julianshen/SWPalette" "master"

Simple usage

//Get image urls
let $ = SwSelect(html)
let imgUrls = $(”img”).attrs(”src”)
for url in imgUrls {
    print(url)
}

//get image urls inside tags with class=a1
let imgUrls2 = $(”.a1″).find(”img”).attrs(”src”)

Please check unit test codes for more usages

Latest podspec

{
    "name": "SwSelect",
    "version": "0.0.2",
    "summary": "This framework could be used for parsing HTML easily with jQuery style queries.",
    "description": "# SwSelectnThis Swift framework provides similar selector implementation to [jQuery](http://jquery.com). It could be used for parsing HTML easily with jQuery style queries. Currently, it supports only tag queries but no content manipulations. Most codes are ported from an Golang project called ["Cascadia"](https://github.com/andybalholm/cascadia).nn## Simple usagen```Swiftn//Get image urlsnlet $ = SwSelect(html)nlet imgUrls = $(u201dimgu201d).attrs(u201dsrcu201d)nfor url in imgUrls {nprint(url)n}nn//get image urls inside tags with class=a1nlet imgUrls2 = $(u201d.a1u2033).find(u201dimgu201d).attrs(u201dsrcu201d)n```nPlease check unit test codes for more usages",
    "homepage": "https://github.com/julianshen/SwSelect",
    "license": "MIT",
    "authors": {
        "Julian Shen": "[email protected]"
    },
    "source": {
        "git": "https://github.com/julianshen/SwSelect.git",
        "tag": "0.0.2"
    },
    "platforms": {
        "ios": "8.0",
        "osx": "10.9"
    },
    "requires_arc": true,
    "module_name": "SwSelect",
    "ios": {
        "libraries": "xml2"
    },
    "xcconfig": {
        "HEADER_SEARCH_PATHS": "$(SDKROOT)/usr/include/libxml2"
    },
    "module_map": "libxml.modulemap",
    "prepare_command": "cat > "libxml.modulemap" << MAPnmodule libxml [system] {n    header "$(SDKROOT)/usr/include/libxml2/libxml/HTMLtree.h"n    header "$(SDKROOT)/usr/include/libxml2/libxml/HTMLparser.h"n    header "$(SDKROOT)/usr/include/libxml2/libxml/xpath.h"n    header "$(SDKROOT)/usr/include/libxml2/libxml/xpathInternals.h"n    header "$(SDKROOT)/usr/include/libxml2/libxml/xmlerror.h"n    link "libxml"n    export *n}nMAP",
    "source_files": "SwSelect/libxml2/libxml2.h",
    "libraries": "xml2"
}

Pin It on Pinterest

Share This