webread.m - odd behavior in 2016B.
Show older comments
I am using MATLAB 2016B and win10Pro. I have a webpage which I want to download the data from.
I try
url1 = 'https://openfigi.com/search#!?search=CUSTOM&pageSize=100&page=1&filters=EXCH_CODE:..cme&simpleSearchString=S%26P500%20EMINI%20OPTN';
url2 = 'http://www.bbc.co.uk/news';
data1a = urlread(url1);
data2a = urlread(url2);
Both these functions execute and return ok. However data1a does not contain the data from the tables. So I then try
data1b = webread(url1);
data2b = webread(url2);
For this both calls return
Error using webread (line 116)
Too many input arguments.
35 throwAsCaller(e)
K>> e
e =
MException with properties:
identifier: 'MATLAB:TooManyInputs'
message: 'Too many input arguments.'
cause: {0×1 cell}
stack: [3×1 struct]
K>> e.stack
ans =
3×1 struct array with fields:
file
name
line
K>> e.stack.file
ans =
C:\Program Files\MATLAB\R2016b\toolbox\matlab\external\interfaces\webservices\restful\+matlab\+internal\+webservices\urlencode.m
ans =
C:\Program Files\MATLAB\R2016b\toolbox\matlab\external\interfaces\webservices\restful\private\encodeInputs.m
ans =
C:\Program Files\MATLAB\R2016b\toolbox\matlab\external\interfaces\webservices\restful\webread.m
I then try and drill down into encodeInputs.m which has the full address:
C:\Program Files\MATLAB\R2016b\toolbox\matlab\external\interfaces\webservices\restful\private\encodeInputs.m
I see the error occurs on line 25
url = matlab.internal.webservices.urlencode(url, options, queryParams{:})
Error using matlab.internal.webservices.urlencode (line 46)
Too many input arguments.
where url is the url I specified, queryParams is an empty cell and options is
options =
weboptions with properties:
CharacterEncoding: 'auto'
UserAgent: 'MATLAB 9.1.0.441655 (R2016b)'
Timeout: 5
Username: ''
Password: ''
KeyName: ''
KeyValue: ''
ContentType: 'auto'
ContentReader: []
MediaType: 'application/x-www-form-urlencoded'
RequestMethod: 'get'
ArrayFormat: 'csv'
HeaderFields: []
CertificateFilename: 'C:\Program Files\MATLAB\R2016b\sys\certificates\ca\rootcerts.pem'
Can anyone help me retrieve the data from url1?
thank you
Accepted Answer
More Answers (0)
Categories
Find more on Web Services in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!