SHARE
TWEET

Untitled

a guest Feb 27th, 2020 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function getData () {
  2.     try {
  3.         const img = document.querySelector('img.zoomImg').src;
  4.         const title = document.querySelector('h1.title').innerText;
  5.         const price = parseInt(document.querySelector('span.price').firstChild.data.replace(',', ''));
  6.         const url = document.URL;
  7.         return { title, img, price, url };
  8.     } catch (err) {
  9.         console.error('Error: ' + err);
  10.         return {}
  11.     }
  12. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top