Error in XML : Empty XML namespace is not allowed

10 次查看(过去 30 天)
Hi everyone .
I,m trying to read a webpage ( which is dictionary webpage ) with matlab and convert html data to text with extractHTMLText for get some informations but MATLAB gives this error :
" Error in XML : Empty XML namespace is not allowed . "
Since I am not a professional programmer , I am not familiar with the namespace and its errors .
code :
url='https://www.vocabulary.com/dictionary/river';
options = weboptions('Timeout', 10);
code = webread(url,options);
textData = extractHTMLText(code);
complete error ( test is my script name ) :
Error using htmlTree (line 67)
Error in XML: xmlns:fb: Empty XML namespace is not allowed
Error in extractHTMLText (line 40)
tree = htmlTree(code);
Error in test (line 12)
textData = extractHTMLText(code)
As you can see , MATLAB has a problem only in the text analysis section of the read web page ( empty namspace error ) . I also checked the " code " variable , which has correctly saved the information of the web page .
Can anyone help me to fix this error ? Thanks .

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 String Parsing 的更多信息

产品


版本

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by