public static string[] ToValues(string html, string objectSelector, string propertySelector) { var htmlObjectSelector = SelectorCache.GetOrAddObject(objectSelector); var htmlNodes = htmlObjectSelector.Execute(html); var htmlPropertySelector = SelectorCache.GetOrAddProperty(propertySelector); return(htmlNodes.Select(htmlPropertySelector.Execute).ToArray()); }
protected internal void SetInternal <TProperty>(PropertyInfo propertyInfo, string propertySelector, Func <string, TProperty> propertyValueParser) { AddSetter((htmlNode, currentObject) => { var htmlPropertySelector = SelectorCache.GetOrAddProperty(propertySelector); var executedPropertyValue = htmlPropertySelector.Execute(htmlNode); var parsedPropertyValue = propertyValueParser(executedPropertyValue); propertyInfo.SetValue(currentObject, parsedPropertyValue); }); }
public static string ToValue(string html, string selector) { var htmlSelector = SelectorCache.GetOrAddProperty(selector); return(htmlSelector.Execute(html)); }