Meta Data

Premades & Resources to be used with Helium Scraper 3
Post Reply
webmaster
Site Admin
Posts: 499
Joined: Mon Dec 06, 2010 8:39 am
Contact:

Meta Data

Post by webmaster » Thu Mar 05, 2020 7:53 pm

Import this function to extract meta data. To use this on your project, follow these instructions.

Code: Select all

function (name)
   Browser.EvalScript
      ·  "try { return document.querySelector(`meta[name=${argument} i]`).getAttribute('content'); } catch (e) { return ''; }"
      ·  name
As a quick example, assuming the premade has been imported as a global called MetaData, the following will extract the page's URL, keywords and description:

Code: Select all

extract
   url
      Gather.URL
   keywords
      MetaData
         ·  "keywords"
   description
      MetaData
         ·  "description"
Juan Soldi
The Helium Scraper Team

Post Reply