Hi all, I’m pulling my hair out, been trying to work out how to parse some html between a span tag. My code is below, any ideas what I’m doing wrong would be appreciated
Hi there, I’m trying to get the product name between the span tag as below. But it doesn’t seem to be wanting to parse it. I’m using print_r($matches) to see if I’m getting any results but I’m getting nothing.
matches returns an array of array of matches… … best way to see this is to do a var_dump($matches) you can then see exactly where in the array your desired value resides.
without knowing what url you are trying to scrape I can only guess, but most likely you are missing some extra whitespace or something. try something more generic like: