Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- node.Attributes["class"].Value
- String val;
- if(node.Attributes["class"] != null)
- {
- val = node.Attributes["class"].Value;
- }
- public static class HtmlAgilityExtender
- {
- public static String ValueOrDefault(this HtmlAttribute attr)
- {
- return (attr != null) ? attr.Value : String.Empty;
- }
- }
- node.Attributes["class"].ValueOrDefault();
- String abc = String.Empty;
- if (tag.Attributes.Contains(@"type"))
- {
- abc = tag.Attributes[@"type"].Value;
- }
- String getURL(){
- return @"some site address";
- }
- List<string> Internalscripts()
- {
- HtmlAgilityPack.HtmlDocument doc = new HtmlWeb().Load((@"" + getURL()));
- //Getting All the JavaScript in List
- HtmlNodeCollection javascripts = doc.DocumentNode.SelectNodes("//script");
- List<string> scriptTags = new List<string>();
- foreach (HtmlNode script in javascripts)
- {
- if(!script.Attributes.Contains(@"src"))
- {
- scriptTags.Add(script.InnerHtml);
- }
- }
- return scriptTags;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement