こんにちは私はここでは出力ソースのスクラップサイトのリンクを削除する必要があります。phpqueryの問題を使用してhrefを削除します。
<div class="FourDayForecastContainerInner">
<span class="day">Friday</span>
<a href="forecastPublicExtended.asp#Period4" target="_blank">
<img src="./images/wimages/b_rain.gif" class="thumbnail">
</a>
<span class="hi">
<span style="width:24px;">Hi</span>
19/66
</span>
<span class="lo">
<span style="width:24px;">Lo</span>
16/60
</span>
<span class="description">
Sunny Breaks, showers
</span>
</div>
<div class="FourDayForecastContainerInner">
<span class="day">Saturday</span>
とここに私のコードImがphpquery
$doc = phpQuery::newDocumentHTML($e);
$containers = pq('.FourDayForecastContainerInner', $doc);
foreach($containers as $container) {
$div = pq('span', $container);
$img = pq('img', $container);
$div->eq(0)
->removeAttr('style')
->addClass('day')
->html(
pq('u', $div->eq(0))
->html()
);
$img->eq(0)
->removeAttr('style')
->removeAttr('height')
->removeAttr('width')
->removeAttr('alt')
->addClass('thumbnail')
->html(pq('img', $img->eq(0)));
$div->eq(1)
->removeAttr('style')
->addClass('hi');
$div->eq(3)
->removeAttr('style')
->addClass('lo');
$div->eq(5)
->removeAttr('style')
->addClass('description');
}
print $doc;
を使用している私は、すべてのスタイルの高さ幅などを属性を削除するために管理してきたが、私はHREF はそんなにありがとう取り除くように見えることはできませんあなたの助け
コードをフォーマットしてください。すべての行を4つの空白でインデントしてブロックコードにします。 (http://stackoverflow.com/editing-helpを参照してください) – Gumbo