How can I tell if a session is cancelled?
Hi. I have a scraping session where all scrapable files are set to "Run by a script". Then I have a main script that gets a list of things to search for from a database, and does a loop through each item. When I Stop the session, the loop contines through all remaning items. The same thing happens if I stop the session from the web interface. It doesnt actaully run the scrapable files, because the scrapable files know that it is stopping, however my script does not know it is stopping. [b]Is there a variable I can check in my loop so that I can break out if stop was selected?[/b]
The main reacon this is a problem is because once an item is completed, I mark off that it is completed in the database. So since my loop doesnt know that the session was stopped, they all get marked as completed.
If there is not a variable I can look at, here is the other idea I had. I could create a simple web page that runs on my local web server which would list all the items to search for from the database. Then create a scrapable page to fetch this page, and an extractor pattern for each item, and run my custom script for each item. Since I am using screen scrapers bult-in functionality, it should stop processing the extractor patters automatically when stop is selected, right?
Thanks, Joe
How can I tell if a session is cancelled?
You're very welcome. Just let us know if we can help with anything else.
Todd
thanks
This is working great. Thank you very much.
How can I tell if a session is cancelled?
Hi Joe,
This was added based on your feedback. It may not be that common in other companies, but we try to be very adaptive to customer needs. We also feel safe doing this as we incorporate quick changes like this into alpha releases, which are obviously not as thoroughly tested as the public releases (though are generally very stable).
If you're evaluating the Enterprise Edition, feel free to upgrade to version 4.0.13a in order to try out the change. This entry in our FAQ may help
http//www.screen-scraper.com/support/faq/faq.php#Upgrade2Alpha
Please just let us know if we can help with anything else.
Kind regards,
Todd
awesome
Todd,
Am I mistaken, or did you just add this functionality based on my feedback? If so, this is phenomenal. This will be a huge benefit to me, and I hope many others as well. I am currently still evaluating Screen scraper enterprise. Will I be able to upgrade to 4.0.13a?
Thank you,
Joe
How can I tell if a session is cancelled?
Hi Joe,
The functionality you're describing isn't in screen-scraper at present. I agree that it's something that would be nice to have, though.
The workaround you're describing should work. Especially if you're working with the Basic Edition, I'd recommend that route.
If you're using the Professional or Enterprise Edition of screen-scraper, I've come up with a slight modification that would get you the functionality you're after. In a script you could invoke this method
session.isRunning();
which would return a boolean indicating whether or not the session itself is still running. If you're running the Professional or Enterprise Edition of screen-scraper you could upgrade to version 4.0.13a in order to be able to use this new method.
Todd