screen-scraper support for licensed users

Questions and answers regarding the use of screen-scraper. Only licensed Professional and Enterprise Edition users can post; anyone can read. Licensed users please contact support with your registered email address for access. This forum is monitored closely by screen-scraper staff. Posts are generally responded to in one business day.

Complete reset of initial HTTP state within a scraping session

Is there a way to reset to the initial HTTP state, just as it was before any scrapeable files are run within a scraping session?

How to scrape an excel file embedded in a website?

I am scraping a website. This site contains an excel file embedded, that can be downloaded to the user's machine. Is it possible to scrape and get the excel file? How do we do that if so?

issue resolved

Thank you for all the help.

Scrape Statistics

We were just having a technical discussion and someone pointed out that we broke 10,000 captcha's on Monday. Figuring it was a gross error in calculations we started talking about our traffic and realized that number was likely accurate. [To be honest, it was an easy captcha. :) ]

But it begged the greater question: Is there any kind of BUILT IN internal or exposed "counter" that will let you know statistics about how much work screen-scraper has done? Like scrapes executed since service start (or EVER?), average speeds, stuff like that? Even just a simple count would be interesting.

troubleshooting scripts

Hello again,

I would like to test some HTML in a test script against various regex patterns.

The final script will process session variables, but when I paste HTML into
session.setVariable("variable",value) the script chokes due to the presence of numerous " and other special characters.

How do I manually setup a variable with all those characters?

Also, once the session variable is created, can I "get" it in the same script?

Best regards,

M

extracting certain pattern occuring several times in a certain location

Greetings,

I have a pattern, f.e. option value="4420",
occuring throughout the page, where I need to extract "4420" and pass it to another page as a session varialbe.
My difficulty is that I need to extract this pattern only within certain part of that page.
I can use DATARECORD to isolate the part of the page I want, but then the subpattern will only apply once within the DATARECORD.
Any suggestions?
I think I might need a script that takes as its input the entire DATARECORD and applies regex to it line by line.

Scraper Session does not finish

I have a scraping session that I am running to download an excel file.
It runs fine, and creates the file. But the scrape session never finishes.
Here are the last few lines of the scrape.

Scraping file: "Excel"
Excel: Processing scripts before a file is scraped.
Processing script: "NationStar_Download_Curr_URL"
Wrote file from: http://www.nationstarbroker.com/RateSheets/Loader.ashx?id=xxxx&of=EXCEL to file: c:\ScrapeWork\NationStar.xlsx
Excel: Preliminary URL: http://www.nationstarbroker.com/RateSheets/Loader.ashx
Excel: Using strict mode.

calling javascript from java script

Greetings,

I would like to have my Scriptable Java script (BeanShell) call another script written in Javascript with 3 values (obtained as parts of DATARECORD), then use a value returned by the javascript.
How do I call another script from a script, and how do I pass values (session.get(set)Variable?)
between Java and Javascript?

Thank you!

Writing to CSV

Hello,
I'm using CsvWriter to write a .csv file. It is very easy to write, but I was confused a bit on my setup.
My CSV header is
String[] header = {"PRODUCT_NAME", "PHONE", "ADDRESS", "BIZURL", "HOURS", "CATEGORY", "SPEC", "SERVICES", "YEAR", "CONTACT", "REVIEW_CONTENT"};

There are 2 scrapeable files in my session:
1st get the following info:
DATARECORD:

- PRODUCT_NAME
- PHONE
- ADDRESS
- BIZURL

and the 2nd:
DATARECORD:

- HOURS
- CATEGORY
- SPEC
- SERVICES
- YEAR
- CONTACT

formatting dates from a text file and passing them to a Scrapeable File

Please review this attempt at an interpreted java script:

dates = dataRecord.get("TheWholeKaboodle");
String [] dates = dates.split(" ");
for ( int i = 0; i < dates.length; i++ ) { // loop over each element
String date = dates[i];
//sutil.reformatDate( "01/01/2010", "MM/dd/yyyy", "yyyy-MM-dd" );
date = sutil.reformatDate(date, "MM/dd/yyyy", "yyyyMMdd" );
session.setVariable("date", date);
//session.scrapeFile("details");
session.log(date); //I hoped this would output reformatted 'date' to the session log in 'debug' mode. Apparently this is not how that works.
}