private void button1_Click(object sender, EventArgs e) { var getdata = new Dictionary <String, List <Double> >(); try { String url1 = "https://www.ariva.de/ado_properties_s-a-aktie/bilanz-guv" + "?page=1"; SortedDictionary <String, List <Double> > daten = new SortedDictionary <String, List <Double> >(); Document dc = NSoup.connect(url1).timeout(6000).get(); } catch (Exception i) { Console.WriteLine($"Generic Exception Handler: {i}"); } }
public NSoup.Nodes.Element getElement(NSoup.Select.Elements elements, RuleConditions r) { var qdoc = elements; if (r.conditionName == "first") { return qdoc.First; } else if (r.conditionName == "eq") { return qdoc.Eq(Convert.ToInt32(r.conditionValue)).First; } else if (r.conditionName == "last") { return qdoc.Last; } else if (r.conditionName == "not") { return qdoc.Not(r.conditionValue).First; } else return qdoc.First; }
private bool TestValidProtocol(Element el, NSoup.Nodes.Attribute attr, HashSet<Protocol> protocols) { // try to resolve relative urls to abs, and optionally update the attribute so output html has abs. // rels without a baseuri get removed string value = el.AbsUrl(attr.Key); if (value.Length == 0) { value = attr.Value; // if it could not be made abs, run as-is to allow custom unknown protocols } if (!_preserveRelativeLinks) { attr.Value = value; } foreach (Protocol protocol in protocols) { string prot = protocol.ToString() + ":"; if (value.ToLowerInvariant().StartsWith(prot)) { return true; } } return false; }
public bool IsSafeAttribute(string tagName, Element el, NSoup.Nodes.Attribute attr) { TagName tag = TagName.ValueOf(tagName); AttributeKey key = AttributeKey.ValueOf(attr.Key); if (_attributes.ContainsKey(tag)) { if (_attributes[tag].Contains(key)) { if (_protocols.ContainsKey(tag)) { Dictionary<AttributeKey, HashSet<Protocol>> attrProts = _protocols[tag]; // ok if not defined protocol; otherwise test return !attrProts.ContainsKey(key) || TestValidProtocol(el, attr, attrProts[key]); } else { // attribute found, no protocols defined, so OK return true; } } } // no attributes defined for tag, try :all tag return !tagName.Equals(":all") && IsSafeAttribute(":all", el, attr); }
public void Tail(NSoup.Nodes.Node node, int depth) { }
public void Head(NSoup.Nodes.Node node, int depth) { node._baseUri = this._baseUri; }