我正在抓取一些网站,我想去掉页面上的 Adobe Flash 广告。我认为它们是“对象”,所以我做了:
window.setInterval(MyFunction, 900);
function MyFunction() {
$('object').remove();
alert('test');
}
我看到了警报,但没有删除“对象”。这怎么可能?我还能尝试什么?
这是(其中一个)广告的外观:
<script src="http://ad.nl.doubleclick.net/adj/P4442.Nu.nl/home;sz=468x60,728x90;dcopt=ist;tile=1;kw=;tt=1000;gr=-5;rg=0;nk=0;u=m6re350ar;;ord=4884951752610505?" type="text/javascript" style="position: relative; margin: 0px; padding: 0px; width: auto; height: auto; border: none; float: left; background-image: none; background-position: initial initial; background-repeat: initial initial;"></script>