I'm updating some code that used to use Xml.parse to parse this page https://www.sec.gov/cgi-bin/browse-edgar?company=&CIK=&type=8-k&owner=exclude&count=100&action=getcurrent
The old code uses Xml to get the table like... this
var pageTxt = UrlFetchApp.fetch(target).getContentText();
var pageDoc = Xml.parse(pageTxt,true);
var table = pageDoc.getElement().body.div.table
Xml is deprecated.
function myFunction() {
var rss = "https://www.sec.gov/cgi-bin/browse-edgar?action=getcurrent&CIK=&type=8-k&company=&dateb=&owner=include&start=0&count=40&output=atom"
var r = UrlFetchApp.fetch(rss).getContentText()
var doc = XmlService.parse(r)
var atom = XmlService.getNamespace(rss)
var table = doc.getRootElement().getChildren('summary', atom)
}
Now I'm trying to use XmlService and having trouble getting that same table
Can some one help with the code to get the table? I need an array to loop through and go through each tr and td. Thanks.