File Exchange

image thumbnail

URL Filter

version 1.2.0.0 (27.7 KB) by Ned Gulley
Scrape one or more numbers off of a web page

39 Downloads

Updated 20 Mar 2018

View License

Editor's Note: This file was selected as MATLAB Central Pick of the Week

Useful when you want automate the process of pulling numbers off of a web page.

Cite As

Ned Gulley (2020). URL Filter (https://www.mathworks.com/matlabcentral/fileexchange/44751-url-filter), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (13)

ali bahreini

hi when i run above code i have below error how can I solve it:
Scraping temperatures for "Monday, 9"...
Undefined function or variable 'convertStringsToChars'.
Error in urlfilter (line 32)
url = convertStringsToChars(url);
Error in Air_1 (line 15)
vals = urlfilter(url,str,2);
thanks for your answer.

ali bahreini

Hello Ned Gulley, thanks for sharing.
Scraping temperatures for "Monday, 9"...
Undefined function or variable 'convertStringsToChars'.
Error in urlfilter (line 32)
url = convertStringsToChars(url);
Error in Air_1 (line 15)
vals = urlfilter(url,str,2);

ali bahreini

Hello Ned Gulley, thanks for sharing.
Undefined function or variable 'convertStringsToChars'.

Error in urlfilter (line 32)
url = convertStringsToChars(url);

Ned Gulley

Thanks for the note @Thiago. I changed the demo file so that it wouldn't point to the missing page anymore.

Gen Li

Thiago

Hello Ned Gulley, thanks for sharing.
Your documentation is still using a page that does not exist anymore. A nice suggestion is:

the_url = 'http://www.mathworks.com/matlabcentral/fileexchange/44751-url-filter';
total_widgets = urlfilter(the_url,'Downloads', 1, 'backward');

This scraps the number of downloads of your file automatically.

Oliver Woodford

Very useful. And it does indeed support numbers with comma separated blocks!

Ned Gulley

Hi @nickname: It's not a VBA macro. All the code is right here in this repo.

nickname

hello,

in regards to your vba macro at http://blogs.mathworks.com/pick/2014/01/17/scraping-data-from-the-web/ , can i please have the complete code for this to work. Please Email eseibel2010@gmail.com Thank you

Ned Gulley

Hi Oliver. Thanks for the note. That should already work. If it doesn't, let me know.

Oliver Woodford

Very useful. It would be great if it supported numbers which have commas separating blocks of digits, e.g. 73,090,906 (around 73 million).

Jui Wu

Ned Gulley

@Beaver: Google does a pretty thorough job of blocking programmatic scraping. I'm not sure you'll be able to get that to work.

Updates

1.2.0.0

Updated to work with MATLAB strings. Demo code is now a Live Script.

1.1.0.0

Updated the demo file.

MATLAB Release Compatibility
Created with R2013b
Compatible with any release
Platform Compatibility
Windows macOS Linux