Extract a table of values from a website

조회 수: 2 (최근 30일)
Maxime Jean Marc Lenoir
Maxime Jean Marc Lenoir 2023년 3월 21일
댓글: Maxime Jean Marc Lenoir 2023년 3월 23일
Hello,
I would like to extract a table of values from the website : https://geometrygeeks.bike/bike/3t-cycling-new-strada-2023/
I would like to exctract the values of each parameter (Reach, Stack ...) in variables.
For the moment, here is my code for the "Reach" parameter:
url='https://geometrygeeks.bike/bike/3t-cycling-new-strada-2023/';
data = webread(url);
table = extractHTMLText(data);
initial=regexp(table,'Add to Compare')+14;
final=regexp(table,'Data Source')-1;
table2=table(initial:final);
reach=regexp(table2,'Reach');
stack=regexp(table2,'Stack');
top_tube=regexp(table2,'Stack');
Reach = str2double(regexp(str2(reach:stack),'\d+','match'));
It almost works, the only problem is that the value extracted in the string using extractHTMLText function are not the same as on the website. How to solve this export problem?
Otherwise, is there an easier way to extract the whole array directly into a matrix?
  댓글 수: 2
Sachin
Sachin 2023년 3월 23일
are you still facing any issue ?
Maxime Jean Marc Lenoir
Maxime Jean Marc Lenoir 2023년 3월 23일
Now I know that I can't use webread so I am looking for the API of the website if it exists. If not I don't really know what to do, do you have some alternatives ?

댓글을 달려면 로그인하십시오.

채택된 답변

Cris LaPierre
Cris LaPierre 2023년 3월 21일

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by