php - 简单的 HTML DOM - 如何通过包含 TD 文本来获取特定的 TR
问题描述
我只需要使用简单的 HTML DOM 从下面的链接中获取所需的行: http ://projects.ednforum.com/salary/tspaydetailsget.php?id=1322733&year=2019-2020
五月或六月或七月或任何其他。
如何仅显示所需的月份行?
我使用了下面的代码,但它不起作用。
include('simple_html_dom.php');
$table = array();
$html2 = file_get_html ('http://projects.ednforum.com/salary/tspaydetailsget.php?id=1322733&year=2019-2020');
$html = str_get_html($html2);
$row = $html->find('table',0)->find('tr');
foreach($row as $data){
if($data->innertext == $month)
{
$value = $data->innertext;
}
}
echo $value;
解决方案
推荐阅读
- scala - ZIO:如何为永远运行的进程加入 Fibers
- zip - 在google colab中解压缩压缩文件
- python-3.x - Tensorflow gradientTape 在计算相同的梯度两次时给出不同的结果
- r - 在 ggplot2 中,如何使绘制的数据透明?
- python-3.x - 如何编写函数以在熊猫中提取 n+1 列
- php - 使用动态变量访问 PHP 数组中的特定值
- javascript - 当我尝试在 android 上运行 react native 应用程序时出现错误
- python - 不期望使用正则表达式输出打印列表
- python-3.x - 如何在 Tensorflow 2.0 中计算输出 wrt 输入的梯度
- android-studio - 我们如何将 Android Studio 与 Github 连接起来?