Ich möchte Google-Anzeigeninhalte auf einer Webseite abrufen. Ich benutze phantomJS, wenn ich ein Bild rendere, kann ich Google Anzeigenblöcke sehen. Aber wenn ich Quelle (html) bekomme, ist es nur Javascript-Code.Get Google Ads content by PhantomJS
Mein einfacher Code.
var fs = require('fs');
var page = require('webpage').create();
var url = "http://www.thegeekstuff.com/2016/04/oracle-undo-tablespace/";
page.open(url);
page.onLoadFinished = function()
{
fs.write("source.htm", page.content, 'w');
page.render('render.png');
phantom.exit();
};
Render Bild haben Google Anzeigen Inhalte.
Aber HTML Quelle:
<p>In the above example, we have two UNDO tablespace listed. But only one of them can be active and used by the system. The other one is currently not used.</p>
<p>So, the best way to view the current valid UNDO tablespace is by using “show parameter” as shown below.</p>
<center>
<div style="margin-left:2px; margin-top:10px; margin-bottom:10px; ">
<!-- AD BLOCK -->
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- TGS Inside Content -->
<ins class="adsbygoogle" style="display: inline-block; width: 300px; height: 250px;" data-ad-client="ca-pub-8090601437064582" data-ad-slot="8643685131" data-adsbygoogle-status="done"><ins id="aswift_1_expand" style="display:inline-table;border:none;height:250px;margin:0;padding:0;position:relative;visibility:visible;width:300px;background-color:transparent"><ins id="aswift_1_anchor" style="display:block;border:none;height:250px;margin:0;padding:0;position:relative;visibility:visible;width:300px;background-color:transparent"><iframe width="300" height="250" frameborder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" allowfullscreen="true" onload="var i=this.id,s=window.google_iframe_oncopy,H=s&&s.handlers,h=H&&H[i],w=this.contentWindow,d;try{d=w.document}catch(e){}if(h&&d&&(!d.body||!d.body.firstChild)){if(h.call){setTimeout(h,0)}else if(h.match){try{h=s.upd(h,i)}catch(e){}w.location.replace(h)}}" id="aswift_1" name="aswift_1" style="left:0;position:absolute;top:0;"></iframe></ins></ins></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<!-- END AD BLOCK -->
Ihnen sehr danken. – kju