urlfilter provides wrong number

5 ビュー (過去 30 日間)
Andreas Neul
Andreas Neul 2020 年 3 月 3 日
コメント済み: Andreas Neul 2020 年 3 月 4 日
Hi,
I am experimenting with ThingSpeak App creation. I am using
url = 'https://www.worldometers.info/world-population/';
filteredData = urlfilter(url,'Germany');
display(filteredData,'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?

採用された回答

Vinod
Vinod 2020 年 3 月 4 日
編集済み: Vinod 2020 年 3 月 4 日
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 = 'https://www.worldometers.info/world-population/germany-population/';
populationDE = urlfilter(url,'The current population of <strong>Germany</strong> is')
  1 件のコメント
Andreas Neul
Andreas Neul 2020 年 3 月 4 日
Yep, this works! Many thanks, Vinod!

サインインしてコメントする。

その他の回答 (0 件)

コミュニティ

その他の回答  ThingSpeak コミュニティ

カテゴリ

Help Center および File ExchangeThingSpeak についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by