if text is found, than skip extraction

Questions and answers about anything related to Helium Scraper
Post Reply
crookedleaf
Posts: 38
Joined: Tue Dec 11, 2012 6:44 pm

if text is found, than skip extraction

Post by crookedleaf » Wed Apr 17, 2013 6:53 pm

i was wondering if it were possible modify the if/while premade to skip extraction if a certain string of text or a certain kind is found. i have a scrape (the one you guys have helped me on a bunch) that goes through a list of resorts (extracted from a page as links) checking for new reservations. if new reservations are found, it goes to the link for the new reservation and extracts the data. if no new reservations are found, it goes to the next resort and repeats the process of checking for new reservations. the thing is, if there are no new reservations, one of two things will happen.

1. out of the list of reservations, no new ones are found and it proceeds automatically to the next resort.

2. a message will be displayed instead of a list of reservations just saying "No bookings found for that time period"

so i'm trying to figure out if it would be possible to add in a step when it goes to list the reservations that says if that text is found (could be set up as a kind), then skip to the next resort. I have a "force select" premade in there right now because the page load is AJAX, so sometimes it can take up to 7 seconds to load the content. so it waits to extract until the list of reservations appears with the timeout set to 10 seconds.

i made a picture to help explain it a bit more:
Untitled.png
Untitled.png (62.78 KiB) Viewed 2766 times

webmaster
Site Admin
Posts: 499
Joined: Mon Dec 06, 2010 8:39 am
Contact:

Re: if text is found, than skip extraction

Post by webmaster » Wed Apr 24, 2013 4:53 pm

If I understand correctly, the 1st case, when no new reservations are found, is already taken care of and you need to skip it on case 2. Also, the message can take a while to show up. What you can do is create a kind that selects the message and then add a Force Select that selects this message with the Ignore if not found after timeout option checked. Then add an If / While action that runs the child actions only if the message is not found and put all your extraction actions inside this If / While.
Juan Soldi
The Helium Scraper Team

crookedleaf
Posts: 38
Joined: Tue Dec 11, 2012 6:44 pm

Re: if text is found, than skip extraction

Post by crookedleaf » Wed Apr 24, 2013 8:42 pm

works perfect! thank you so much, again :D

Post Reply