0
$html = file_get_html('https://m.gsmarena.com/');
$videos = [];
foreach ($html->find('div.swiper-half-slide') as $video) {
foreach ($video->find('strong')as $name){

   echo $name->innertext;
   $videos[]=$name;
}}
print_r($videos);

im getting fatalerror Allowed memory size of 536870912 bytes exhausted (tried to allocate 268439552 bytes) in C:\xampp\htdocs\scrappingpractise\scraper.php on line 24

Faateih
  • 29
  • 6
  • Did you even search for an answer before posting? Duplicate of: https://stackoverflow.com/questions/415801/allowed-memory-size-of-33554432-bytes-exhausted-tried-to-allocate-43148176-byte – John Cogan Feb 18 '20 at 11:02
  • Does this answer your question? [Allowed memory size of 33554432 bytes exhausted (tried to allocate 43148176 bytes) in php](https://stackoverflow.com/questions/415801/allowed-memory-size-of-33554432-bytes-exhausted-tried-to-allocate-43148176-byte) – John Cogan Feb 18 '20 at 11:03

1 Answers1

0

You are running out of memory, by default PHP allows you to allocate 256mb for each execution. You can change it in your php.ini file, the option it's called memory_limit

Daniel
  • 141
  • 10