NavigationUser loginscreen-scraper.com welcomes...
Currently online
There are currently 0 users and 1 guest online.
|
Tutorial 4: Page 3: Invoking screen-scraper from Java
Before we dig into the code let's review a few things related to invoking screen-scraper via Java. First, your Java code will need to have two jars in its classpath: screen-scraper.jar (found in the root screen-scraper install folder) and log4j.jar (found in screen-scraper's "lib" folder). For convenience we've packaged all of the files you'll need in this zip file. Download that file and unzip it. You'll notice that we also include an Ant build file that you can use to compile and run the sample class. In order to invoke screen-scraper from Java, screen-scraper needs to be running in server mode. If you'd like a refresher on how to start up screen-scraper in server mode go ahead and follow that link, then come back here. Okay, let's try it out before we dive into the code. Start screen-scraper running as a server. If you're using Ant simply type "ant run" at a command prompt inside of the folder where the build.xml files is found. If that didn't go quite as you expected here are some things to check:
Assuming that test worked, fire up your favorite Java editor and open the "Shopping.java" file in it. The file is pretty heavily commented, so hopefully it makes sense what's going on. If not, try reviewing our Java documentation, posting to our forum, or sending us a support request. When you invoke screen-scraper as a server it creates log files corresponding to your scraping session in its "log" folder. Take a look in that folder for your "Shopping Site" log file and take a look through it. It should look similar to what you see when you run scraping sessions in the workbench.
|
SearchNew Video!Tags Throughout this Site |
Recent comments
12 hours 43 min ago
12 hours 50 min ago
14 hours 56 min ago
1 day 10 hours ago
1 day 10 hours ago
1 day 11 hours ago
1 day 11 hours ago
1 day 11 hours ago
1 day 11 hours ago
3 days 8 hours ago