Class Scraper

Namespace
Subsembly.Scraper
Assembly
Subsembly.Scraper.dll

Convenient base implementation with method stubs for IScraper.

public abstract class Scraper : IScraper
Inheritance
Scraper
Implements
Derived
Inherited Members

Constructors

Scraper(string, int)

public Scraper(string sScraperName, int nPriority = 100)

Parameters

sScraperName string

Display name of this scraper implementation. Must not be null or empty.

nPriority int

Fields

SCRAPERPRIORITY_HIGH

High priority.

public const int SCRAPERPRIORITY_HIGH = 1000

Field Value

int

SCRAPERPRIORITY_LOW

Low priority.

public const int SCRAPERPRIORITY_LOW = 10

Field Value

int

SCRAPERPRIORITY_NORMAL

The default priority for all scrapers.

public const int SCRAPERPRIORITY_NORMAL = 100

Field Value

int

Properties

AllProductInfos

public ScraperProductInfo[] AllProductInfos { get; }

Property Value

ScraperProductInfo[]

ClassName

Returns the name of the class, as it was given to the constructor.

public string ClassName { get; }

Property Value

string

Name

Returns the name that was given to the constructor.

public string Name { get; }

Property Value

string

Priority

Returns the priority value that was given to the constructor.

public int Priority { get; }

Property Value

int

Methods

AddBankAccountProduct(string, string, string, Func<SepaIBAN, bool>)

protected ScraperProductInfo AddBankAccountProduct(string sProductName, string sIconName, string sLoginUrl, Func<SepaIBAN, bool> fnMatchIBAN)

Parameters

sProductName string
sIconName string
sLoginUrl string
fnMatchIBAN Func<SepaIBAN, bool>

Returns

ScraperProductInfo

AddBankAccountProduct(string, string, string, string, params string[])

Add a bank account product with IBAN account numbers supported by this scraper.

protected ScraperProductInfo AddBankAccountProduct(string sProductName, string sIconName, string sLoginUrl, string sCountryCode, params string[] vsBankCodes)

Parameters

sProductName string

The ProductName of the bank account. Must not be null or an empty string. Usually this is a trivial string like "Postbank Konto".

sIconName string

The name of the icon that shall be presented with this bank account. Must not be null or an empty string.

sLoginUrl string

The URL where the user usually interactively logs in, in order to access this account. This may be presented on the UI as a fallback if the screen scraper fails.

sCountryCode string

The country code that must appear in the IBAN for this account product. Must not be null or an empty string.

vsBankCodes string[]

A list of bank codes that must appear in the IBAN for this account product. Must not be null or an empty array. must be overridden.

Returns

ScraperProductInfo

Remarks

It is not needed to add each kind of bank account, e.g. current account, savings account, etc.. Usually a single bank account product entry is enough for all bank accounts of a bank.

AddCreditCardProduct(string, string, string, params string[])

Add a credit card product supported by this scraper.

protected ScraperProductInfo AddCreditCardProduct(string sProductName, string sIconName, string sLoginUrl, params string[] vsBinRanges)

Parameters

sProductName string

The ProductName of the credit card. Must not be null or an empty string.

sIconName string

The name of the icon that shall be presented with this bank account. Must not be null or an empty string.

sLoginUrl string

The URL where the user usually interactively logs in, in order to access this account. This may be presented on the UI as a fallback if the screen scraper fails.

vsBinRanges string[]

A list of BIN ranges for the credit card product.

Returns

ScraperProductInfo

Remarks

The new ScraperProductInfo is created with the ScraperAccountNumberType PAN. If the screen scraper needs an IBAN instead, then this must be changed on the returned product info instance.

AddCreditCardWithIbanProduct(string, string, string, string, params string[])

protected ScraperProductInfo AddCreditCardWithIbanProduct(string sProductName, string sIconName, string sLoginUrl, string sCountryCode, params string[] vsBankCodes)

Parameters

sProductName string
sIconName string
sLoginUrl string
sCountryCode string
vsBankCodes string[]

Returns

ScraperProductInfo

AddProduct(ScraperProductType, ScraperAccountNumberType, string, string, string, string, string[])

protected ScraperProductInfo AddProduct(ScraperProductType nProductType, ScraperAccountNumberType nAccountNumberType, string sProductName, string sIconName, string sLoginUrl, string sCountryCode, string[] vsAccountNumberRanges)

Parameters

nProductType ScraperProductType
nAccountNumberType ScraperAccountNumberType
sProductName string
sIconName string
sLoginUrl string
sCountryCode string
vsAccountNumberRanges string[]

Returns

ScraperProductInfo

AddProduct(ScraperProductType, string, string, string, Func<SepaIBAN, bool>)

protected ScraperProductInfo AddProduct(ScraperProductType nProductType, string sProductName, string sIconName, string sLoginUrl, Func<SepaIBAN, bool> fnMatchIBAN)

Parameters

nProductType ScraperProductType
sProductName string
sIconName string
sLoginUrl string
fnMatchIBAN Func<SepaIBAN, bool>

Returns

ScraperProductInfo

CanScrape(JsonObject)

public bool CanScrape(JsonObject jsAcct)

Parameters

jsAcct JsonObject

Returns

bool

CreateContact(JsonObject)

public IScraperContact CreateContact(JsonObject jsAcct)

Parameters

jsAcct JsonObject

Returns

IScraperContact

GetProductInfo(JsonObject)

public ScraperProductInfo GetProductInfo(JsonObject jsAcct)

Parameters

jsAcct JsonObject

Returns

ScraperProductInfo

OnCreateScraperContact(SepaAccount)

No default implementation. Must be provided by the derived class.

public abstract IScraperContact OnCreateScraperContact(SepaAccount aAcct)

Parameters

aAcct SepaAccount

Returns

IScraperContact