Split and Contains method Bot

Hi guys, I am trying to create this bot where I have to use Split and Contains methods that extracts sentences containing “UiPath” from a UiPath blog post. For some reason keeps giving me an error.

• Use Open Browser activity to open URL “https://www.uipath.com/blog
• Use Click Activity to open a blog post
• Use Get Text activity to store all text from a blog post of UiPath website in a string variable
called blogText.
• Use blogText.Split(“.”c) and store all sentences in an array called blogSentence
• Use For Each activity and iterate through each item in the array blogSentence
• Use If activity within For Each activity to identify sentence that contains the string “UiPath
in it. Use item.Contains(“UiPath”) as condition.
• Use Type Into activity to store result in a MS Word file

Any idea what the problem can be?


please share the error along the occuring data with us. Thanks


This is what is comes up as soon it starts runnning on the asssign activity with expression blogText.Split(“.”c).

in case of such null exceptions can not be found / fixed by Code analysis then debugging is done. Have a check if there is a relationship on text where no sentence contains uiapth.

Is somehing with the selector on the Get Text acitivity. Have you tried it perhaps?

Hi @Frederico_Barreto,

The variable that you’re trying to refer to in the Assign is null. Please check that the value is being picked up/assigned correctly. You can check which variable is null by running in debug and checking the variables in the Locals panel when the exception occurs

1 Like

Hi @william.coulson ,

Thanks fro your help :slight_smile: