Can't find the weather & slashdot examples

Hi,
Where do I find the weather & slashdot examples?

Can't find the weather & slashdot examples

the tutorials are great, but more examples would help. can't you just create some examples on the screen-scrapper.com site that we could scrape?

great product, just needs better documentation and examples for simple people like me :?

Can't find the weather & slashdot examples

gdixon,

As you mentioned, you do need to save the dataset first in a session variable, which can be done by checking the box next to "Automatically save the data set generated..." The name that will be used by the scraping session is the one given the data set in the "Identifier" field.

Next, here is an old ASP example. Make sure to make the appropriate changes to reflect the identifiers used in your scraping session.

<html>
<head><title>Slashdot screen-scraper results</title></head>
<body>
<%
' Create the object.
Set objRemoteSession = Server.CreateObject&#40;"Screenscraper.RemoteScrapingSession"&#41;

' Set up the remote session.
Call objRemoteSession.Initialize&#40;"Slashdot"&#41;

' Check for errors.
If objRemoteSession.IsError Then
        Response.Write&#40; "Error&#58; " & objRemoteSession.GetErrorMessage &#41;
Else
%>
        Scraping data...
<%
        Response.Flush
       
        ' Tell screen-scraper to scrape the data.
        Call objRemoteSession.Scrape
%>
        data scraped.<br>
        Outputting results...
<%     
        Response.Flush

        ' Write out the results.
       
        ' Retrieve and store the saved data set.
        objRemoteSession.StoreVariable&#40;"DATASET"&#41;
%>
        <table border="1" cellpadding="5" align="center">
                <tr>
                        <th>Story Title</th>
                        <th>Topic</th>
                        <th>Posted By</th>
                        <th>Posted Date</th>
                        <th>Department</th>
                        <th>Story</th>
                </tr>
<%     
        ' Walk through the results.
        For i = 0 To objRemoteSession.GetNumDataRecordsForDataSet&#40; "DATASET" &#41; - 1
%>
                <tr>
<%
                ' The story title may contain a white link, so we make it blue instead.
                Response.Write&#40; "<td>" & Replace&#40; objRemoteSession.GetDataSetValue&#40; "DATASET", i, "STORY_TITLE" &#41;, "FFFFFF", "336699" &#41; & "</td>" &#41;
                Response.Write&#40; "<td>" & objRemoteSession.GetDataSetValue&#40; "DATASET", i, "TOPIC" &#41; & "</td>" &#41;
                Response.Write&#40; "<td>" & objRemoteSession.GetDataSetValue&#40; "DATASET", i, "POSTED_BY_NAME" &#41; & "</td>" &#41;
                Response.Write&#40; "<td>" & objRemoteSession.GetDataSetValue&#40; "DATASET", i, "POSTED_DATE" &#41; & "</td>" &#41;
                Response.Write&#40; "<td>" & objRemoteSession.GetDataSetValue&#40; "DATASET", i, "DEPARTMENT" &#41; & "</td>" &#41;
                Response.Write&#40; "<td>" & objRemoteSession.GetDataSetValue&#40; "DATASET", i, "STORY" &#41; & "</td>" &#41;
                Response.Flush
%>
                </tr>
<%
        Next
%>
        </table>
<%     
End If

' Disconnect from the server.
Call objRemoteSession.Disconnect
%>
</body>
</html>

Brent
screen-scraper.com

Where to Find the Examples

While I understand you do not want to provide the live examples anymore, what do you provide as an alternative? I am having trouble with data sets when calling from an external ASP script and I cannot find anything in the current documentation to help. As I understood from the examples last time, when you call from external, when calling for a Data Set scrape, you still need an internal script to identify and set the data set array which I no longer know how to do without the examples. Any ideas? Thanks. :roll:

Can't find the weather & slashdot examples

edisonc,

That is a valid question. We no longer bundle those examples with screen-scraper. We found that we looked bad when one of those other sites changed. Instead, our tutorials include examples of scraping sites which we do have control over the content. Those are the current examples.

I am sorry for any inconvenience this may have caused. If you have any further feedback on this issue please let us know what you think.

Brent
screen-scraper.com