title: How to get data from other website using php?
body: <p>This is my first question on this site, sorry if it is not clear enough.</p>
  
  <p>So my problem is that, i would like to get all of the product IDs from a webshop, that has no API.
  A product id looks like: xy-000000</p>
  
  <p>I know that I need a webscraper, but the problem is that i don’t know how to find a specific word like xy- 000000 with it. I tried many web-scrapers, but the only thing that i could find with them is html tags like the title or keywords. </p>
  
  <p>I searched a lot for it on google, and found some web scrapers, bat they are not working fine for me.</p>
  
  <p>As i mentioned, i would like to get all of the product IDs from a different webshop using php, for finding some products that i am not selling. (My webshop has the same product IDs as the other.)</p>
  
  <p>Can anyone please help me find a php script that is similar to what i need?</p>
  
  <p>So this is the code that i am trying to use:</p>
  
  <pre><code> &lt;?php
      $data = file_get_contents('https://www.mesemix.hu/hu/superman-ruhanemuk/11292-szuperhosoek-mintas-zokni.html');
  
      error_reporting(0);
  
      preg_match('/&lt;title&gt;([^&lt;]+)&lt;\/title&gt;/i', $data, $matches);
      $title = $matches[1];
  
      preg_match('/[0-9]{6}/', $data, $matches);
      $number = $matches[1];
  
      preg_match('/&lt;img[^&gt;]*src=[\'"]([^\'"]+)[\'"][^&gt;]*&gt;/i', $data, $matches);
      $img = $matches[1];
  
      echo $title."&lt;br&gt;\n";
      echo $img."&lt;br&gt;\n";
      echo $number;
      echo $data;
      ?&gt;
  </code></pre>
  
  <p>The problem is that i can not find the 6 digit number with it. ($number)</p>
  
  <p>In the webshop's source code it looks like this:</p>
  
  <p>var productReference = 'SP- 418070';</p>
  
  <p>If there is anything wrong with my question please let me know.</p>