Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getData () {
- try {
- const img = document.querySelector('img.zoomImg').src;
- const title = document.querySelector('h1.title').innerText;
- const price = parseInt(document.querySelector('span.price').firstChild.data.replace(',', ''));
- const url = document.URL;
- return { title, img, price, url };
- } catch (err) {
- console.error('Error: ' + err);
- return {}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement