Skip to content

Instantly share code, notes, and snippets.

@larrybolt
Created October 11, 2015 17:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save larrybolt/9d4a36af1257249272a5 to your computer and use it in GitHub Desktop.
Save larrybolt/9d4a36af1257249272a5 to your computer and use it in GitHub Desktop.
Data mining on torfs
// https://www.torfs.be/damesschoenen/+merk=fred-perry
/* search source code for the products
<article class="product thumb">
<a href="/fred-perry-blauwe-slip-on-155138" data-product_id="155138" data-product_brand="{brand}" data-product_cat="damesschoenen" data-product_price_bare="59.95" >
<div class="img">
<img src="https://3.assets.torfs.be/products/155138/fred-perry-blauwe-slip-on-155138-thumb-210x210-1428112805.jpg" alt="Fred Perry Blauwe Slip-on" />
<div class="labels">
<span class="discount">-10%</span>
</div>
</div>
<h3 class="title">Fred Perry Blauwe Slip-on</h3>
<div class="price-wrapper">
<span class="price old">
<b>&euro; 59.95</b>
</span>
<span class="price current new">
<b>&euro; 53.95</b>
</span>
</div>
<div>
<span class="small secondary button text-upper exclusive-online">&rarr;
<b>Exclusief</b> online
</span>
</div>
</a>
</article>
*/
$('article.product').each(function(){
console.log(
$('h3.title', this).text(),
$('span.price.current', this).text(),
$('img[src]', this).attr('src')
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment