Course Dashboard

TF Import: Grabbers and Processors

25%

Grab Content from External Sources

This page is used to add a new or edit an existing Grabber. To create a new grabber, click on "New" and then select the type of Grabber. To edit an existing Grabber, click on the title from the list of Grabbers.

You can grab or get content from any web page (Html or Xml) or external URL using Document Object Model. This requires you to know the source code of the external web page.

To view the source code, right click on the browser and select "View Source". You can also use keyboard shortcut: ctrl + U.

There are multiple types of Grabbers. You can use them depending upon what you need to extract.

1. Html Code

Use this to get HTML code inside any parent HTML tag or element. For example: div, article, table

Example: To Get HTML inside <div class="content"></div>

  • Type: Html Code
  • HTML Tag: div
  • Attribute Name: class
  • Attribute Value: content

2. Html Value

Use this to get value of any HTML tag or element. For example: h1, title

Example: To Get Browser Title

  • Type: Html Value
  • HTML Tag: title

Example: To Get Article Heading from h1 tag

  • Type: Html Value
  • HTML Tag: h1

3. Html Attribute

Use this to get value of any attribute of HTML tag or element. For example: src, href

Example: To Get Open Graph Image from Meta Tag

  • Type: Html Attribute
  • HTML Tag: meta
  • Attribute Name: property
  • Attribute Value: og:image
  • Attribute to Fetch: content

4. Xml Value

Use this to get value of any tag from XML document.

5. XML Attribute

Use this to get value of any attribute from XML document.

6. Json as Array

Use this to get Json value of HTML tag or element. The JSON value gets converted to Array. For example: script

7. Array Value

Use this to get value of array for any specific key (numeric or associative). This is useful for both single and multi dimensional arrays.

8. Custom Value

Use this to set any custom defined value instead of getting content from external sources.

9. Multiple

Use this to combine or apply multiple Grabber rules.

Options Tab

Tag (Required): Main HTML or XML tag or element to grab content from.

Attribute Name (Optional): To target specific tags, you can add a condition where specific attribute exists in an element. Enter the name of the attribute here.

Attribute Value (Optional): To target specific tags, you can add a condition where the attribute has some specific value. Enter the value of the attribute here.

Element Value (Optional): To target specific tags, you can add a condition where the value contains any string. Enter the string here.

Get As Array: Enable this to get multiple elements or values as array.

Array Index Number: When there are more than one matching tags, you can increase this number to get appropriate content.

Attribute to Fetch: This is applicable where you want to get the value of Attribute. Enter the name of the attribute for which you want to get the value. For example, href to get the links or src to get the url of image.