Neshoonak Scripts



public class MyScript: ScriptBase
{
    public void Execute()
    {
        // Your Page Scripts Goes Here
    }


    // Your Common Scripts Goes Here

}


public abstract class ScriptBase { NameValueCollection args { get; } Uri Uri { get; } string RequestUrl { get; } string ResponseUrl { get; } bool IsGet { get; } bool IsPost { get; } Element Root { get; } QueryString QueryString { get; } string PageName { get; } string Title { get; } string DocumentText { get; } string ExtractionDate { get; } // Format: yyyy/MM/dd HH:mm:ss string ExtractionDateShamsi { get; } // Format: yyyy/MM/dd HH:mm:ss int GET(string pageName, IEnumerable<string> urls, NameValueCollection argsValue); int GET(string pageName, string url, NameValueCollection argsValue); int GET(string pageName, string url, NameValueCollection argsValue, string requestHeaders, bool enforce, string destinationFolder = null); int POST(string pageName, string url, NameValueCollection argsValue, string requestHeaders, string postData); int POST(string pageName, string url, NameValueCollection argsValue, string requestHeaders, string postData, Cookie[] cookies = null); string GetAttachment(string url, string destinationFolder, string requestHeaders); string PostAttachment(string url, string destinationFolder, string requestHeaders, string postData, Cookie[] cookies = null); string param(string parameterName); int GetTotalWebpageCount(); string CacheFileName(Uri uri, string extension); void SaveHtml(string destinationFolder, bool downloadExternalLinks, bool localizeLinksAndScripts, bool localizeHyperLinks, bool localizeImages); void SaveHtml(string html, string destinationFolder, bool downloadExternalLinks, bool localizeLinksAndScripts, bool localizeHyperLinks, bool localizeImages); string MakeAbsoluteUrl(string relativeUri); string SerializeJson(object obj); T DeserializeJson<T>(string json) where T : class; string GetResponseCookieText(string cookieName = null); ElementCollection dom(string selectorText); ElementCollection dom(Element root, string selectorText, string capture); Parser parser(string inputText); dynamic NewRecord(); void Insert(string tableName, object r, string keyFields); void alert(object value); void alert2(string format, params object[] args); string DownloadText(string url, string requestHeaders = null, string method = "GET", string postData); Image DownloadImage(string url, string requestHeaders = null, string method = "GET", string postData); string Simple_OCR(Image image, string patternFileName); void NothingFound(); string GetJsonPropertyValue(string properties); string GetJsonPropertyValue(string properties, string json); int RecordCount(string tableName); string gstr(string globalVariableName); voi gstr(string globalVariableName, string value); long gint(string globalVariableName); void gint(string globalVariableName, long value); static string GetDirectoryName(string rootFolder, Uri uri); }
public class Element { static Element Empty { get; } string this [string attributeName] { get; } string Id { get; } string Name { get; } string Value { get; } string Text { get; } string PlainText { get; } string Html { get; } string InnerHtml { get; } string Url { get; } string Title { get; } string Alt { get; } string TitleOrAlt { get; } string CssClass { get; } object Body { get; } bool IsEmpty { get; } string SelectorText { get; } ElementCollection Children { get; } ElementCollection dom(string selectorText); string GetRelativeSelector(string parentSelector); Element GetParentByTagName(string tagName); Element GetParentByClassName(string className); Element GetParentByAttribute(string attributeName, string attributeValue); Element Child(int index); Element Child(int index, string tag); ElementCollection GetSiblings(bool next, bool includeMe, string tagName) string GetAttribute(string attributeName); string Capture(CaptureType captureType, string attr = ""); string GetAttribute(string attributeName); string GetValueOrText(object option); void SetValue(string value); void Remove(Element item); void Remove(ElementCollection list); void Clear(); void AddHtml(string html); }
  Loading...