0

When I using jSoupLink, I found strange behaviour

First, I load jSoupLink and define linkList

<< jSoupLink`
linkList = \
{"https://www.nobelprize.org/nobel_prizes/physics/laureates/2015/\
kajita-facts.html", 
   "https://www.nobelprize.org/nobel_prizes/physics/laureates/2015/\
mcdonald-facts.html", 
   "https://www.nobelprize.org/nobel_prizes/physics/laureates/2014/\
akasaki-facts.html"};

Now the below Map works fine

Map[
 StringSplit[
   ParseHTML[#, ".laureate_info_wrapper p", "text"], {",", 
    ":"}] &, linkList]

However ParallelMap gives strse error

ParallelMap[
 StringSplit[
   ParseHTML[#, ".laureate_info_wrapper p", "text"], {",", 
    ":"}] &, linkList]

will gives errors

StringSplit::strse: String or list of strings expected at position 1 in StringSplit[jSoupLink`ParseHTML[https://www.nobelprize.org/nobel_prizes/physics/laureates/2015/kajita-facts.html,.laureate_info_wrapper p,text],{,,:}].

It seems not the problem of ParseHTML, because

ParallelMap[
 ParseHTML[#, ".laureate_info_wrapper p", "text"]&, linkList]

has no problem.

What is wrong?

matheorem
  • 17,132
  • 8
  • 45
  • 115
  • You probably need to load the definitions for jSoupLink into the parallel kernels (e.g. by DistributeDefinitions or by loading them explicitly). – WReach May 17 '16 at 14:24
  • @WReach Hi, WReach. I updated my post. I think it is not the problem of jSoupLink – matheorem May 17 '16 at 14:30

0 Answers0