MATLAB Answers

urlfilter provides wrong number

3 views (last 30 days)
Andreas Neul
Andreas Neul on 3 Mar 2020
Commented: Andreas Neul on 4 Mar 2020
I am experimenting with ThingSpeak App creation. I am using
url = '';
filteredData = urlfilter(url,'Germany');
I get this response:
Germany = 19
instead of the currently correct response of 83697339.
How do I need to modify above code so that I get the correct number?

Accepted Answer

Vinod on 4 Mar 2020
Edited: Vinod on 4 Mar 2020
It appears that the website loads its data dynamically (i.e., data is loaded into the page's DOM asynchronously after the initial page is loaded). You will have to scrape it from the page that is loaded when you click "Germany". Try:
url = '';
populationDE = urlfilter(url,'The current population of <strong>Germany</strong> is')
  1 Comment
Andreas Neul
Andreas Neul on 4 Mar 2020
Yep, this works! Many thanks, Vinod!

Sign in to comment.

More Answers (0)



More Answers in the  ThingSpeak Community

Community Treasure Hunt

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

Start Hunting!