1

I am using ImportXML to get some data from a website which looks like the following:

=ImportXML("https://www.papercall.io/events?cfps-scope=&keywords=uk","//div[@class='panel panel-default']")

While it gets the data ok, two of the fields are both headings <h4> and the sheet seems to be importing both of these together into one field. Is there a way I can change the formula above to either change the <h4> into a <p> or just to add a line break after the <h4> is closed?

4
  • formula returns #N/A
    – user0
    Commented Jul 23, 2019 at 14:44
  • Yes because I'm not using the real website. I will edit it.
    – jonroper
    Commented Jul 23, 2019 at 14:51
  • i.sstatic.net/kDr6c.png which cell(s) is the one bothering you and how do you wish it to look like?
    – user0
    Commented Jul 23, 2019 at 15:55
  • Column A is fine. Column B has a URL and then dates that I would want to be separated. I would want the event date to go into column C.
    – jonroper
    Commented Jul 24, 2019 at 8:48

1 Answer 1

0
  • you can regex it like this:

=ARRAYFORMULA({INDEX(IMPORTXML(
 "https://www.papercall.io/events?cfps-scope=&keywords=uk", 
 "//div[@class='panel panel-default']"),,1), 
 IFERROR(REGEXEXTRACT(INDEX(IMPORTXML(
 "https://www.papercall.io/events?cfps-scope=&keywords=uk",
 "//div[@class='panel panel-default']"),,2), "(.*)Event Dates")), 
 IFERROR(REGEXEXTRACT(INDEX(IMPORTXML(
 "https://www.papercall.io/events?cfps-scope=&keywords=uk",
 "//div[@class='panel panel-default']"),,2), "(Event Dates.*)"))})

enter image description here

1
  • 1
    That works perfectly. Thanks!
    – jonroper
    Commented Jul 25, 2019 at 10:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.