Reading a specific word from a webpage


#1

Hi!

I want to read a word from a webpage (to be used later to find a right folder that is named after that word).

The word is always after the word “category”, however always has numbers in front of it, for example it can look like this:

Category: “56333000 - Thing…”

Or

Category: “79345 - Name…”

I do not want to copy the numbers, they are not meaningful for my purpose.

Is there some way to leave out the numbers and the “-” out, and just copy word (“Thing” or “Name”).
The amount of numbers/characters before the word is not defined, it can be 4, 5 or even 6 numbers sometimes. The minus sign ( “-”) is always there.

Best Regards
Johanna


#2

Hi @JohannaKes,

Use Matches activity.

Pattern : ((?<=Category: ")[\d]+)

you will get integer value alone.

Regards,
Arivu


#3

Hi Johanna,

Another way is to take the hole word into a string variable (ExtractedWord) and Split by “-” character and extract the second element like this:
name = ExtractedWord.Split("-".ToCharArray)(1)

Thanks,
Ninett


#4

Thank you, they both work, but found it easier to use the second option!

BR
Johanna