WhiteHatBox
Share Page
Following(0)
Partner(s)
jrwrest

scrape fail and continue on with code

ReplyThanks 2016/08/28 15:18:16 0 0

hi


I am wanting to scrape to see if some text is there if not continue on with the code. The problem if the text is there it comes up with error and stops the code running.


How can I check if the text is there with out the scraper failing?

Aprilcaicai
2016/08/28 23:09:59

Just save the scraped value to a variable, and then use if command to judge it. If there is value for it, if not and then continue on with the code.

You'd better watch the video and document first before you go to create your own bot.

jrwrest
2016/08/29 01:36:55
Hi I can do this, the issue is that the value I try to scape sometimes isn't there so the scraper has nothing to scrape and then comes up with an error
Aprilcaicai
2016/08/29 01:52:03
There is a video to show you how to use the scrape command on YouTube, you can go to view it first, and what we can do is to make sure that there is no problem for the command. You need to use your own knowledge to solve it. Of course if you cannot do it, we can do it for you, but it is not free.
jrwrest
2016/08/29 02:08:16

ok which youtube clip are you talking about?


I know how to use the scrape command the issue is sometimes the site has a pop up so i want to take a different acition if the pop up is there but if i run the scrape and the pop up isnt there i get an error, because what I'm trying to scrape isnt there/

Aprilcaicai
2016/08/29 06:13:37
You can add a If command to judge when there is no error for it.
jrwrest
2016/08/29 06:40:27
the issue was I was using a string to scrape the data and if the data wasn't there I got an error. how I fixed it was change the string to a table. with 2 colomns one for my pop up one for something that was on the page i get success when I test :) and can use the if command
WhiteHatBox
2016/08/30 00:20:02

got it, you are smart :)

and I think you can also use a tryCatch action when scrape using string variable. if there is no data, the it will go into the catch part.

Let's ROCK!
<< < 1> >>
VerifyCode
Advanced Option