0

Hell people I would like to replace/delete some columns from html.

First I got the table from TradingView like this

$html= file_get_contents('https://www.tradingview.com/markets/stocks-usa/market-movers-gainers/');
                                        
$start = strpos($html,'<table class="table-DR3mi0GH"');
$end =  strpos($html,'</table>',$start);
$data = substr($html,$start,$end-$start);

All works fine

Then I replaced some html with this code

$data = preg_replace('#<sup class="apply-common-tooltip tickerDescription-hMpTPJiS"(.*?)</sup>#', '', $data);`

Now im stuck deleting/replacing some columns inside the table because the all have the same class

you can check here https://tradingjunkie.space/test.php

The columns I want to delete are :

Market cap

P/E (TTM)

EPS (TTM)

Employees

Any ideas how can I do this ?

bondikho
  • 1
  • 4

0 Answers0