Class ScrapedData
A flexible dictionary of object values used to conveniently store
scraped data of any Type in a key-value dictionary which can be saved
as JSON using the Yield method. ScrapedData can hold data objects of
any Type, including Classes.
E.g:
var Data = new ScrapedData();
Data['title'] = "Page Title";
Data['date'] = DateTime.Now;
Inheritance
System.Object
ScrapedData
Assembly: IronWebScraper.dll
Syntax
public class ScrapedData : Dictionary<string, object>
Constructors
ScrapedData()
Declaration
Methods
FromJson(String)
Deserializes a ScrapedData object from JSON created using the
toJson() method.
Declaration
public static ScrapedData FromJson(string json)
Parameters
| Type |
Name |
Description |
| System.String |
json |
|
Returns
Get<T>(String)
Returns the specified ScrapedData item cast as the appropriate type.
E.g:
Get<string>("url");
Declaration
public T Get<T>(string key)
Parameters
| Type |
Name |
Description |
| System.String |
key |
Key
|
Returns
Type Parameters
Exceptions
| Type |
Condition |
| System.Collections.Generic.KeyNotFoundException |
|
ToJson()
Converts the ScrapedData to a JSON string.
Declaration
Returns
| Type |
Description |
| System.String |
|