Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* http://www.ozon.ru/default.aspx?context=cart */
- r = [];
- $('.cartTable').filter(':not(:last)').each(function() {
- r.push((function(b){
- var t=[];
- b.find('.hr').each(function() {
- var c=$(this), s='';
- t.push({
- 'link': (d=c.find('.photo a')).attr('href'),
- 'photo': d.find('img').attr('src'),
- 'name': (s=c.find('.name a').text().trim()),
- 'author': c.find('.name h3').text().trim().substr(s.length).trim(),
- 'weight': c.find('.weight').text().trim(),
- 'delivery': c.find('.delivery').text().trim(),
- 'qty': c.find('.qty .btn').text().trim(),
- 'total': c.find('.total').text().trim()
- });
- });
- return t;
- })($(this)));
- });
- h = ['photo','name','author','weight','delivery','qty','total']; console.log(h.join(' ')); v = function(d){ var r=[]; for(var i in h) { r.push(d[h[i]]); } return r; }
- for(var i in r) { if (!r.hasOwnProperty(i)) continue; var t=r[i]; for(var j in t) { if (!t.hasOwnProperty(j)) continue; var d=t[j]; console.log(v(d).join(' ')) } };
Advertisement
Add Comment
Please, Sign In to add comment