Imports Screenscraper Module Shopping Sub Main() 'Generate a RemoteScrapingSession object, which 'acts as the driver, or interface, to screen-scraper. 'If you're running screen-scraper on a different computer 'than the one the VB file resides on you'll want to 'modify and use the top version instead of the bottom one. 'RemoteScrapingSession remoteScrapingSession = new RemoteScrapingSession("Shopping Site", "192.168.0.5", 8778 ); Dim remoteScrapingSession As RemoteScrapingSession = New RemoteScrapingSession("Shopping Site") 'Set the variables. 'Remember that these two top variables correspond to the POST 'parameters we use for the "Login" scrapeable file. remoteScrapingSession.SetVariable("EMAIL_ADDRESS", "test@test.com") remoteScrapingSession.SetVariable("PASSWORD", "testing") 'screen-scraper will use this parameter to search the products. remoteScrapingSession.SetVariable("SEARCH", "dvd") 'We start screen-scraper at page 1 of the search results. 'Note that we could have also done this in an "initialize" 'script within screen-scraper, which is common. remoteScrapingSession.SetVariable("PAGE", "1") 'Tell the session to scrape. This method call might take 'a little while since it will need to wait for screen-scraper 'to fully extract the data before it returns. remoteScrapingSession.Scrape() 'Get the data set that was stored by screen-scraper in a 'session variable. This data set corresponds to the "PRODUCTS" 'extractor pattern found under the "Details page" scrapeable 'file. Dim products As DataSet = remoteScrapingSession.GetVariable("PRODUCTS") 'Iterate through each of the data records screen-scraper 'extracted, outputting each of them to the browser. Dim i As Integer For i = 0 To products.NumDataRecords - 1 Dim product As DataRecord product = products(i) Console.WriteLine("=======================================") Console.WriteLine("Product #" + i.ToString) Console.WriteLine("Title: " + product.Item("TITLE")) Console.WriteLine("Model: " + product.Item("MODEL")) Console.WriteLine("Shipping Weight: " + product.Item("SHIPPING_WEIGHT")) Console.WriteLine("Manufactured By: " + product.Item("MANUFACTURED_BY")) Console.WriteLine("=======================================") Next 'Be sure to disconnect from the server. remoteScrapingSession.Disconnect() End Sub End Module