When you want to retrieve 10 rows from div[@class='card-body']
, I think that you can achieve it using a xpath as follows.
Sample formula 1:
=IMPORTXML("https://www.klsescreener.com/v2/announcements/stock/5199", "//div[@class='announcements']/a[position()<=10]//div[@class='card-body']")
Result:
Sample formula 2:
When you want to check whether the value of ACQUISITION
is included in the retrieved values, how about the following sample formula?
Sample 1:
=REGEXMATCH(TEXTJOIN("",TRUE,IMPORTXML("https://www.klsescreener.com/v2/announcements/stock/5199", "//div[contains(@class,'card-body')]")),"ACQUISITION")
- This is from the comment.
Sample 2:
=REGEXMATCH(TEXTJOIN("",TRUE,IMPORTXML("https://www.klsescreener.com/v2/announcements/stock/5199", "//div[@class='announcements']/a[position()<=10]//div[@class='card-body']")),"ACQUISITION")
- In this case,
ACQUISITION
is retrieved from 10 rows. And, when the value of ACQUISITION
is included, TRUE
is returned.
Reference:
=QUERY(ARRAYFORMULA(IMPORTXML("https://www.klsescreener.com/v2/announcements/stock/5199", "//div[contains(@class,'card-body')]")),"select Col1, Col2 limit 10",-1)
is what you want? – Tanaikeselect
ofI want to select all the col data
you are thinking? For example, you want to activate the columns? – Tanaike=REGEXMATCH(TEXTJOIN("",TRUE,IMPORTXML("https://www.klsescreener.com/v2/announcements/stock/5199", "//div[contains(@class,'card-body')]")),"ACQUISITION")
In this case, whenACQUISITION
included in the retrieved data,TRUE
is returned. If I misunderstood your replying, I apologize. – Tanaike