Get Text element from Webpage if exists, continue on error otherwise

Hi everyone,

I am currently working on a research project where I need to get some information from a webpage. Basically I am looping through a bunch of URLs and try to extract multiple text elements. These text elements get written into an excel file. My Problem is that not every single URL has all necessary text elements. So it would be great to have some kind of exception handler that writes an empty cell or a specific character (like #) if one of the elements is not found on the current URL and than continues the worklflow. I tried “try catch” but I could not get it working…
An example where not all text elements are available would be (https://www-sciencedirect-com.eaccess.ub.tum.de/science/article/pii/S0361368299000562)

Main.xaml (35.9 KB)

Attached you can find my workflow. Any help appreciated!

Best regards!

Hi @Florian92,

Try using element exist which returns Boolean value true or false,based on the condition you can continue the process without any interrupt .

Thanks,

Hi @Gouda_6, I am aware of this possibility. But if I have 6-7 elements, I do have to create that many “elements exists” and “if else” statements. I was wondering is there is any more efficient solution to that problem?

hi @Florian92,

Set true for continue on error property so even though it fails it continues.

Thanks,

Hi @Gouda_6, I think “elements exists” does not have a “continue on error” property…?

@Florian92,

You can use On Element Appear activity and set False to RepeatForEver in properties.

2 Likes

In the end I was working with an “exist element” activity, followed by an “if else” activity to check whether the element existed and if not print a defined character in the respective cell. That worked perfect for me!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.