Skip to content

Instantly share code, notes, and snippets.

@brianpow
Last active September 29, 2017 00:09
Show Gist options
  • Save brianpow/7e31a8a4df1760bd8bf7a2eb8494fb22 to your computer and use it in GitHub Desktop.
Save brianpow/7e31a8a4df1760bd8bf7a2eb8494fb22 to your computer and use it in GitHub Desktop.
//For https://www.dpreview.com/products/search/cameras
(function($) {
var all = []
var parse = function() {
$("td.info").each(function() {
all.push([
$("div.name", this).text(),
$("div.announcementDate", this).text(),
$("div.prices", this).text(),
].concat($("div.shortProductSpecs", this).text().split("|")).join("\t"))
})
}
var show = function(result) {
console.log("show")
if (!$("#result").size())
$("<textarea id=result />").css({
width: "100%",
height: "100px"
}).prependTo(document.body)
$("#result").html(
all.join("\n")
)
}
parse()
show(all)
})(jQuery)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment