I've scraped a web page and I'm trying to extract data from a td
that has no class or ids. Let's say I have the following html:
<table>
<tr>
<td>Title</td>
<td>The Harsh Face of Mother Nature</td>
</tr>
.
.
.
</table>
I'm trying to do a preg_match
:
$title = preg_match("\(>Title)(.*?)(?=<\/td\>{2})\", $html);
My pattern starts with >Title
and the ending is the 2nd occurrence of </td>
.
I've been working with https://regex101.com/ to try to figure this out, but regex is really tough! Especially with the obscure stuff I'm trying to accomplish. Any help, please? Thanks!
(edit below:)
The goal is to get a sting like: </td><td>The Harsh Face of Mother Nature
then to do another preg match to remove the first part and have the final product of The Harsh Face of Mother Nature