5 Replies Latest reply on Apr 25, 2018 11:30 PM by kumar bharat

    R script takes forever!

    Yoav Kamin

      Hi,

      I'm trying to scrape meta description of ~2500 websites using R.

      I'm using the following script in the calculated field called "Meta Description (v2)":

      SCRIPT_STR

      (

      "

      if (url.exists(.arg1))

      {

      if (!http_error(.arg1))

      {

      pgHTML = read_html(.arg1)

      pgMetaDescr = pgHTML %>% html_nodes('meta[name=description]') %>% html_attr('content')

      if (length(pgMetaDescr)==0) {''} else {pgMetaDescr}

      } else {''}

      } else {''}

      ",

      min([Domain])

      )

       

      I've pre-loaded all the required packages through R config file.

      When I'm dragging the calculated field to the label and changing the "compute using" to "cell" it works for a few domains.

      But when I'm choosing additional domains (let's say I'm adding 10 domains in the quick filter) it takes very long time to return the values.

      Did someone encounter similar issue or knows what should I change in order to make it run faster?

       

      * I'm using Tableau Desktop 10.5

       

      Thanks!