在我的代码中,这始终为我提供首页内容。我知道分页参数之前的页面加载。我如何获得正确的内容。我应该怎么做才能找到正确的解决方案?
for ($page=1; $page<3500; $page++) {
$doc = new \DOMDocument();
@$doc->loadHTMLFile("https://steamcommunity.com/market/search?appid=730#p".$page."_popular_desc");
$xpath = new \DOMXPath($doc);
$elements = $xpath->query('//span[@class="market_listing_item_name"]');
$array = iterator_to_array($elements);
$newArr = array();
foreach ($array as $arr) {
$newArr[] = array(
"itemName" => $arr->textContent
);
}
}