C# Class AmazonScrape.Scraper

Performs page and image loads and provides methods to encode/decode strings.
Show file Open project: ThomasRush/AmazonScrape Class Usage Examples

Public Methods

Method Description
CreateHttpRequest ( Uri URL ) : String

Given a URL, loads and returns a string representing a web page's markup

DecodeHTML ( string html ) : string

Decodes the HTML-encoded sections of the supplied string

DoEvents ( ) : void

Used to force the background worker to wait for a condition before proceeding.

DownloadWebImage ( Uri url ) : BitmapImage
EncodeURL ( string URL ) : string

Encodes the supplied string for use as a URL

LoadReviewHistogram ( string asin ) : string

Given a product's unique Amazon ID, loads the review distribution histogram. Much faster than an entire pageload for detailed review info.

LoadSearchPage ( int pageIndex, string searchTerms ) : string

Loads the result page based on the criteria and the supplied page index, determines the number of valid results on the page, and returns a list of strings representing the markup for each result on the page. Those results can be used by the other Scraper methods to obtain specific pieces of data (e.g. product name).

Method Details

CreateHttpRequest() public static method

Given a URL, loads and returns a string representing a web page's markup
public static CreateHttpRequest ( Uri URL ) : String
URL System.Uri
return String

DecodeHTML() public static method

Decodes the HTML-encoded sections of the supplied string
public static DecodeHTML ( string html ) : string
html string HTML-encoded string
return string

DoEvents() public static method

Used to force the background worker to wait for a condition before proceeding.
public static DoEvents ( ) : void
return void

DownloadWebImage() public static method

public static DownloadWebImage ( Uri url ) : BitmapImage
url System.Uri
return System.Windows.Media.Imaging.BitmapImage

EncodeURL() public static method

Encodes the supplied string for use as a URL
public static EncodeURL ( string URL ) : string
URL string string to encode
return string

LoadReviewHistogram() public static method

Given a product's unique Amazon ID, loads the review distribution histogram. Much faster than an entire pageload for detailed review info.
public static LoadReviewHistogram ( string asin ) : string
asin string
return string

LoadSearchPage() public static method

Loads the result page based on the criteria and the supplied page index, determines the number of valid results on the page, and returns a list of strings representing the markup for each result on the page. Those results can be used by the other Scraper methods to obtain specific pieces of data (e.g. product name).
public static LoadSearchPage ( int pageIndex, string searchTerms ) : string
pageIndex int
searchTerms string
return string