Code Monkey home page Code Monkey logo

appwerft.ti.soup's Introduction

Ti.Soup

Titanium module for parsing remote HTML. It is Titanium version of Jsoup.

Usage

var Soup = require("de.appwerft.soup").createSoup({
	url : "http://www.deutschlandfunk.de/irak-tote-und-verletzte-bei-anschlag-in-tikrit.1939.de.html?drn:news_id=721951"
	onload : function() {
		var res = Soup.getElementById("ati").getAttributes();
		console.log(res);
	} 
});

You can use all getters from jsoup page

var Soup = require("de.appwerft.soup").createSoup({
	url : "http://www.deutschlandfunk.de/irak-tote-und-verletzte-bei-anschlag-in-tikrit.1939.de.html?drn:news_id=721951"
	onload : function() {
		var elem = Soup.getElementById("ati");
		console.log(elem.firstElementSibling());
	} 
});

jQuery like selectors

You can use jQuery like selectors like:

var Soup = require("de.appwerft.soup").createSoup({
	url : "http://www.deutschlandfunk.de/irak-tote-und-verletzte-bei-anschlag-in-tikrit.1939.de.html?drn:news_id=721951"
	onload : function() {
		var elems = Soup.select("img[src$=.png]");
		console.log(elems.getAttributes())
	} 
});

Parsing local HTML

var Soup = require("de.appwerft.soup").createSoup({
	html : "<html><body><div id="23" attr="ATTRIBUTE">CONTENT</div></body></html>"
});
Soup.getElementById("23").getAttributes();

appwerft.ti.soup's People

Watchers

James Cloos avatar Brenton House avatar

Forkers

creador

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.