How do you extract from a website table?
Mostra commenti meno recenti
I'm trying to extract data from the table on this page(http://www.newyorkschools.com/districts/nyc-district-11.html).
I've tried tp uses webread but it isn't quite working for me. I'm attempting to extract the school names and the grade level and them place that into an excel file. (Helping a friend starting a stem program)
How do you think I should do?
url ='http://www.newyorkschools.com/districts/nyc-district-7.html';
data = webread(url)
tree=htmlTree(url)
selector = 'School Name'
subtrees = findElement(tree,selector)
subtrees(:)
Risposta accettata
Più risposte (2)
Seth Furman
il 6 Giu 2022
0 voti
Try the approach suggested in the following MATLAB Answers post.
You can use readtable https://www.mathworks.com/help/matlab/ref/readtable.html
url = "https://www.mathworks.com/help/matlab/text-files.html";
T = readtable(url,TableSelector="//TABLE[contains(.,'readtable')]", ...
ReadVariableNames=false)
Categorie
Scopri di più su MATLAB in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!