Advertisement
nicolaslagios

Emplifi.io Scrap Javascript

Aug 7th, 2023
686
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 0.77 KB | Source Code | 0 0
  1. const feedItems = document.querySelectorAll('.feed_wrapper_UXNAU .content_wrapper_mkIJf');
  2. const data = [];
  3. data.push('Name\tDate\tContent');
  4. feedItems.forEach(item => {
  5.   try {
  6.     const name = item.querySelector('div:first-child div:first-child div:nth-child(2) div:nth-child(2) div:first-child div:first-child strong').textContent.trim();
  7.     const date = item.querySelector('div:first-child div:first-child div:nth-child(3) div:first-child').textContent.trim();
  8.     const content = item.querySelector('div:first-child div:nth-child(2) div:first-child div:first-child div:first-child').textContent.trim();
  9.     data.push(`${name}\t${date}\t${content}`);
  10.   } catch (error) {
  11.     console.error('Error extracting data from an item:', error);
  12.   }
  13. });
  14. console.log(data.join('\n'));
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement