加载javascript而不是解析源代码

时间:2019-06-04 19:06:03

标签: javascript jquery ajax

我正在尝试从其他网站空间解析源。问题是其他网站空间使用javascript加载了新闻。而且,在新闻发布之前,此处Stackoverflow或Google上的每个代码都会解析源代码

我知道它不适用于php,因此我尝试通过jquery进行尝试,但未成功。

$(document).ready(function() { 
	$.ajax({
	        url: 'https://www.habbo.com/',
	        success: function(data){
	            $("#textarea").val(data);
	        }
	})
  });
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<textarea style="width:100%; height:900px;" id="textarea"></textarea>

这是我想要得到的结果:

<html ng-app="app" lang="de"><head><style type="text/css">@charset "UTF-8";[ng\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}</style><style id="stndz-style">div[class*="item-container-obpd"], a[data-redirect*="paid.outbrain.com"], a[onmousedown*="paid.outbrain.com"] { display: none !important; } a div[class*="item-container-ad"] { height: 0px !important; overflow: hidden !important; position: absolute !important; } div[data-item-syndicated="true"] { display: none !important; } .grv_is_sponsored { display: none !important; } .zergnet-widget-related { display: none !important; } </style><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="robots" content="NOODP"><title>Finde Freunde, hab Spass und werde bemerkt! - Habbo</title><meta name="description" content="Registriere dich GRATIS im grössten virtuellen Hotel weltweit! Triff und finde Freunde spiele Spiele, chatte mit anderen, erstelle deinen Avatar, entwerfe Räume und mehr..."><meta property="og:type" content="website"><meta property="og:site_name" content="Habbo"><meta property="og:title" content="Finde Freunde, hab Spass und werde bemerkt!"><meta property="og:description" content="Registriere dich GRATIS im grössten virtuellen Hotel weltweit! Triff und finde Freunde spiele Spiele, chatte mit anderen, erstelle deinen Avatar, entwerfe Räume und mehr..."><meta property="og:url" content="https://www.habbo.de/" habbo-head-url="content"><meta property="og:image" content="https://images.habbo.com/habbo-web/america/de/assets/images/app_summary_image-1200x628.85a9f5dc.png"><meta property="og:image:height" content="628"><meta property="og:image:width" content="1200"><meta name="twitter:card" content="summary_large_image"><meta name="twitter:title" content="Finde Freunde, hab Spass und werde bemerkt!"><meta name="twitter:description" content="Registriere dich GRATIS im grössten virtuellen Hotel weltweit! Triff und finde Freunde spiele Spiele, chatte mit anderen, erstelle deinen Avatar, entwerfe Räume und mehr..."><meta name="twitter:image" content="https://images.habbo.com/habbo-web/america/de/assets/images/app_summary_image-1200x628.85a9f5dc.png"><meta name="twitter:site" content="@De_Habbo"><meta itemprop="name" content="Finde Freunde, hab Spass und werde bemerkt!"><meta itemprop="description" content="Registriere dich GRATIS im grössten virtuellen Hotel weltweit! Triff und finde Freunde spiele Spiele, chatte mit anderen, erstelle deinen Avatar, entwerfe Räume und mehr..."><meta itemprop="image" content="https://images.habbo.com/habbo-web/america/de/assets/images/app_summary_image-1200x628.85a9f5dc.png"><meta name="apple-itunes-app" content="app-id=794866182"><meta name="fragment" content="!"><meta name="revision" content="9661fe6"><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"><meta name="prerender-status-code" prerender-status-code="" content="200"><meta name="prerender-header" prerender-header="" content="Location: https://www.habbo.de/hotel"><link rel="canonical" href="https://www.habbo.de/" habbo-head-url="href"><link rel="shortcut icon" href="https://images.habbo.com/habbo-web/america/de/assets/images/favicon.08c747be.ico"><link rel="icon" sizes="196x196" href="https://images.habbo.com/habbo-web/america/de/assets/images/app_icon-196x196.42aab784.png"><link rel="apple-touch-icon" href="https://images.habbo.com/habbo-web/america/de/assets/images/app_icon-60x60-precomposed.99edad69.png"><link rel="apple-touch-icon" sizes="76x76" href="https://images.habbo.com/habbo-web/america/de/assets/images/app_icon-76x76-precomposed.e106f3ac.png"><link rel="apple-touch-icon" sizes="120x120" href="https://images.habbo.com/habbo-web/america/de/assets/images/app_icon-120x120-precomposed.18320473.png"><link rel="apple-touch-icon" sizes="152x152" href="https://images.habbo.com/habbo-web/america/de/assets/images/app_icon-152x152-precomposed.b6728e86.png"><link rel="alternate" type="application/rss+xml" href="https://www.habbo.de/rss.xml" title="Habbo News"><link rel="prefetch" href="https://images.habbo.com/habbo-web-l10n/de.json"><link rel="prefetch" href="https://images.habbo.com/habbo-web/america/de/assets/images/sprite.541175ea.png"><link rel="prefetch" href="https://images.habbo.com/habbo-web/america/de/assets/images/sprite@2x.2c5de56d.png" media="(-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi), (min-resolution: 2dppx)"><link rel="prefetch" href="https://images.habbo.com/habbo-web/america/de/assets/images/backgrounds/hotel.ba57eb56.png"><link rel="stylesheet" href="https://images.habbo.com/habbo-web/america/de/app.228084b6.css"><script async="" type="text/javascript" src="https://www.googletagservices.com/tag/js/gpt.js"></script><script src="https://connect.facebook.net/de_DE/sdk.js?hash=47eba3f4bdde48bbb7044ef343f2acbd&amp;ua=modern_es6" async="" crossorigin="anonymous"></script><script type="text/javascript" async="" src="https://www.google-analytics.com/plugins/ua/linkid.js"></script><script type="text/javascript" async="" src="https://www.google-analytics.com/plugins/ua/ecommerce.js"></script><script type="text/javascript" defer="" async="" src="//trck.spoteffects.net/analytics/spef.min.js"></script><script async="" src="//www.google-analytics.com/analytics.js"></script><script>window.prerenderReady=!1</script><meta http-equiv="x-dns-prefetch-control" content="off"><script>window.session=null;window.geoLocation={"country":"ch","continent":"eu"};window.partnerCodeInfo=null;window.systemData={"open":true};</script><style type="text/css">.fb_hidden{position:absolute;top:-10000px;z-index:10001}.fb_reposition{overflow:hidden;position:relative}.fb_invisible{display:none}.fb_reset{background:none;border:0;border-spacing:0;color:#000;cursor:auto;direction:ltr;font-family:"lucida grande", tahoma, verdana, arial, sans-serif;font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:1;margin:0;overflow:visible;padding:0;text-align:left;text-decoration:none;text-indent:0;text-shadow:none;text-transform:none;visibility:visible;white-space:normal;word-spacing:normal}.fb_reset>div{overflow:hidden}@keyframes fb_transform{from{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}.fb_animate{animation:fb_transform .3s forwards}
.fb_dialog{background:rgba(82, 82, 82, .7);position:absolute;top:-10000px;z-index:10001}.fb_dialog_advanced{border-radius:8px;padding:10px}.fb_dialog_content{background:#fff;color:#373737}.fb_dialog_close_icon{background:url(https://static.xx.fbcdn.net/rsrc.php/v3/yq/r/IE9JII6Z1Ys.png) no-repeat scroll 0 0 transparent;cursor:pointer;display:block;height:15px;position:absolute;right:18px;top:17px;width:15px}.fb_dialog_mobile .fb_dialog_close_icon{left:5px;right:auto;top:5px}.fb_dialog_padding{background-color:transparent;position:absolute;width:1px;z-index:-1}.fb_dialog_close_icon:hover{background:url(https://static.xx.fbcdn.net/rsrc.php/v3/yq/r/IE9JII6Z1Ys.png) no-repeat scroll 0 -15px transparent}.fb_dialog_close_icon:active{background:url(https://static.xx.fbcdn.net/rsrc.php/v3/yq/r/IE9JII6Z1Ys.png) no-repeat scroll 0 -30px transparent}.fb_dialog_iframe{line-height:0}.fb_dialog_content .dialog_title{background:#6d84b4;border:1px solid #365899;color:#fff;font-size:14px;font-weight:bold;margin:0}.fb_dialog_content .dialog_title>span{background:url(https://static.xx.fbcdn.net/rsrc.php/v3/yd/r/Cou7n-nqK52.gif) no-repeat 5px 50%;float:left;padding:5px 0 7px 26px}body.fb_hidden{height:100%;left:0;margin:0;overflow:visible;position:absolute;top:-10000px;transform:none;width:100%}.fb_dialog.fb_dialog_mobile.loading{background:url(https://static.xx.fbcdn.net/rsrc.php/v3/ya/r/3rhSv5V8j3o.gif) white no-repeat 50% 50%;min-height:100%;min-width:100%;overflow:hidden;position:absolute;top:0;z-index:10001}.fb_dialog.fb_dialog_mobile.loading.centered{background:none;height:auto;min-height:initial;min-width:initial;width:auto}.fb_dialog.fb_dialog_mobile.loading.centered #fb_dialog_loader_spinner{width:100%}.fb_dialog.fb_dialog_mobile.loading.centered .fb_dialog_content{background:none}.loading.centered #fb_dialog_loader_close{clear:both;color:#fff;display:block;font-size:18px;padding-top:20px}#fb-root #fb_dialog_ipad_overlay{background:rgba(0, 0, 0, .4);bottom:0;left:0;min-height:100%;position:absolute;right:0;top:0;width:100%;z-index:10000}#fb-root #fb_dialog_ipad_overlay.hidden{display:none}.fb_dialog.fb_dialog_mobile.loading iframe{visibility:hidden}.fb_dialog_mobile .fb_dialog_iframe{position:sticky;top:0}.fb_dialog_content .dialog_header{background:linear-gradient(from(#738aba), to(#2c4987));border-bottom:1px solid;border-color:#1d3c78;box-shadow:white 0 1px 1px -1px inset;color:#fff;font:bold 14px Helvetica, sans-serif;text-overflow:ellipsis;text-shadow:rgba(0, 30, 84, .296875) 0 -1px 0;vertical-align:middle;white-space:nowrap}.fb_dialog_content .dialog_header table{height:43px;width:100%}.fb_dialog_content .dialog_header td.header_left{font-size:12px;padding-left:5px;vertical-align:middle;width:60px}.fb_dialog_content .dialog_header td.header_right{font-size:12px;padding-right:5px;vertical-align:middle;width:60px}.fb_dialog_content .touchable_button{background:linear-gradient(from(#4267B2), to(#2a4887));background-clip:padding-box;border:1px solid #29487d;border-radius:3px;display:inline-block;line-height:18px;margin-top:3px;max-width:85px;padding:4px 12px;position:relative}.fb_dialog_content .dialog_header .touchable_button input{background:none;border:none;color:#fff;font:bold 12px Helvetica, sans-serif;margin:2px -12px;padding:2px 6px 3px 6px;text-shadow:rgba(0, 30, 84, .296875) 0 -1px 0}.fb_dialog_content .dialog_header .header_center{color:#fff;font-size:16px;font-weight:bold;line-height:18px;text-align:center;vertical-align:middle}.fb_dialog_content .dialog_content{background:url(https://static.xx.fbcdn.net/rsrc.php/v3/y9/r/jKEcVPZFk-2.gif) no-repeat 50% 50%;border:1px solid #4a4a4a;border-bottom:0;border-top:0;height:150px}.fb_dialog_content .dialog_footer{background:#f5f6f7;border:1px solid #4a4a4a;border-top-color:#ccc;height:40px}#fb_dialog_loader_close{float:left}.fb_dialog.fb_dialog_mobile .fb_dialog_close_button{text-shadow:rgba(0, 30, 84, .296875) 0 -1px 0}.fb_dialog.fb_dialog_mobile .fb_dialog_close_icon{visibility:hidden}#fb_dialog_loader_spinner{animation:rotateSpinner 1.2s linear infinite;background-color:transparent;background-image:url(https://static.xx.fbcdn.net/rsrc.php/v3/yD/r/t-wz8gw1xG1.png);background-position:50% 50%;background-repeat:no-repeat;height:24px;width:24px}@keyframes rotateSpinner{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}
.fb_iframe_widget{display:inline-block;position:relative}.fb_iframe_widget span{display:inline-block;position:relative;text-align:justify}.fb_iframe_widget iframe{position:absolute}.fb_iframe_widget_fluid_desktop,.fb_iframe_widget_fluid_desktop span,.fb_iframe_widget_fluid_desktop iframe{max-width:100%}.fb_iframe_widget_fluid_desktop iframe{min-width:220px;position:relative}.fb_iframe_widget_lift{z-index:1}.fb_iframe_widget_fluid{display:inline}.fb_iframe_widget_fluid span{width:100%}</style><link rel="preload" href="https://adservice.google.ch/adsid/integrator.js?domain=www.habbo.de" as="script"><script type="text/javascript" src="https://adservice.google.ch/adsid/integrator.js?domain=www.habbo.de"></script><link rel="preload" href="https://adservice.google.com/adsid/integrator.js?domain=www.habbo.de" as="script"><script type="text/javascript" src="https://adservice.google.com/adsid/integrator.js?domain=www.habbo.de"></script><script src="https://securepubads.g.doubleclick.net/gpt/pubads_impl_2019052302.js" async=""></script><link rel="stylesheet" href="https://d3hmp0045zy3cs.cloudfront.net/HEAD/providers.css" type="text/css"></head><body habbo-client-disable-scrollbars="" class="" style=""><!----><div class="content" ui-view="" style=""><!----><habbo-header-small ng-if="!HomeController.hasHeaderLarge()" active="home"><habbo-header-ad><!----><div ng-if="HeaderAdController.hasAd" class="header-ad"><habbo-ad-unit unit="leaderboard" class="header-ad__ad"><!----><habbo-ad-double-click ng-if="AdUnitController.hasAds() &amp;&amp; !AdUnitController.isAdsPrevented()" unit="leaderboard"><div id="div-gpt-ad-2" ng-dfp-ad="div-gpt-ad-2" translation="Drittanbieter-Anzeige" class="ad-double-click"></div></habbo-ad-double-click><!----></habbo-ad-unit></div><!----></habbo-header-ad><header class="header__wrapper wrapper"><a href="/" class="header__habbo__logo"><h1 class="header__habbo__name" id="ga-linkid-habbo">Habbo</h1></a><!----><habbo-user-menu habbo-require-session="" class="header__aside header__aside--user-menu"><div ng-init="toggle = false;" habbo-false-on-outside-click="toggle" class="user-menu"><div class="user-menu__header"><a ng-click="toggle = !toggle;" class="user-menu__toggle"><div class="user-menu__name__wrapper"><div class="user-menu__name" ng-class="{ 'user-menu__name--open': toggle }">BartTotal</div></div><habbo-imager figure="hr-3525-35.hd-195-1.ch-878-82-84.lg-3320-64-1408.sh-3068-91-1320.fa-3276-72.cc-3389-82-91" name="BartTotal" size="bighead" class="user-menu__avatar"><img ng-src="/habbo-imaging/avatar/hr-3525-35.hd-195-1.ch-878-82-84.lg-3320-64-1408.sh-3068-91-1320.fa-3276-72.cc-3389-82-91%2Cs-2.g-1.d-2.h-2.a-0%2C1e6e6045462e928513b1c88f6533a00a.png" ng-srcset="/habbo-imaging/avatar/hr-3525-35.hd-195-1.ch-878-82-84.lg-3320-64-1408.sh-3068-91-1320.fa-3276-72.cc-3389-82-91%2Cs-2.g-1.d-2.h-2.a-0%2C1e6e6045462e928513b1c88f6533a00a.png 1x" ng-style="{ 'min-width': ImagerController.dimensions.width }" alt="BartTotal" width="54" height="62" class="imager" src="/habbo-imaging/avatar/hr-3525-35.hd-195-1.ch-878-82-84.lg-3320-64-1408.sh-3068-91-1320.fa-3276-72.cc-3389-82-91%2Cs-2.g-1.d-2.h-2.a-0%2C1e6e6045462e928513b1c88f6533a00a.png" srcset="/habbo-imaging/avatar/hr-3525-35.hd-195-1.ch-878-82-84.lg-3320-64-1408.sh-3068-91-1320.fa-3276-72.cc-3389-82-91%2Cs-2.g-1.d-2.h-2.a-0%2C1e6e6045462e928513b1c88f6533a00a.png 1x" style="min-width: 54px;"></habbo-imager></a></div><ul ng-hide="!toggle" class="user-menu__list ng-hide"><li class="user-menu__item"><a ng-href="/profile/BartTotal" ng-class="{ 'user-menu__link--active': UserMenuController.isMyProfileActive() }" class="user-menu__link user-menu__link--profile" translate="NAVIGATION_PROFILE" href="/profile/BartTotal">Profil ansehen</a></li><li class="user-menu__item"><a href="/settings" ng-class="{ 'user-menu__link--active': UserMenuController.isSettingsActive() }" class="user-menu__link user-menu__link--settings" translate="NAVIGATION_SETTINGS">Einstellungen</a></li><li class="user-menu__item"><a ng-href="https://habbohelpde.zendesk.com/home" class="user-menu__link user-menu__link--help" target="_blank" rel="noopener noreferrer" translate="NAVIGATION_HELP" href="https://habbohelpde.zendesk.com/home">Hilfe</a></li><li class="user-menu__item"><a ng-click="UserMenuController.logout()" class="user-menu__link user-menu__link--logout" translate="NAVIGATION_LOGOUT">Logout</a></li></ul></div></habbo-user-menu><!----><!----></header><habbo-navigation active="home"><nav class="navigation"><ul class="navigation__menu"><li class="navigation__item"><a href="/" ng-class="{ 'navigation__link--active': NavigationController.active === 'home' }" class="navigation__link navigation__link--home navigation__link--active" translate="NAVIGATION_HOME" id="ga-linkid-home">Startseite</a></li><li class="navigation__item"><a href="/community" ng-class="{ 'navigation__link--active': NavigationController.active === 'community' }" class="navigation__link navigation__link--community" translate="NAVIGATION_COMMUNITY" id="ga-linkid-community">Community</a></li><li class="navigation__item"><a href="/shop" ng-class="{ 'navigation__link--active': NavigationController.active === 'shop' }" class="navigation__link navigation__link--shop" translate="NAVIGATION_SHOP" id="ga-linkid-shop">HabboShopping</a></li><li class="navigation__item"><a href="/playing-habbo" ng-class="{ 'navigation__link--active': NavigationController.active === 'playingHabbo' }" class="navigation__link navigation__link--playing-habbo" translate="NAVIGATION_PLAYING_HABBO" id="ga-linkid-playing-habbo">Habbo spielen</a></li><!----><li habbo-require-session="" class="navigation__item navigation__item--aside navigation__item--hotel"><!----><habbo-hotel-button habbo-require-flash=""><a href="/hotel" class="hotel-button" id="ga-linkid-hotel"><span class="hotel-button__text" translate="NAVIGATION_HOTEL">Hotel</span> </a></habbo-hotel-button><!----></li><!----></ul></nav></habbo-navigation><div class="wrapper" ng-transclude=""></div></habbo-header-small><!----><!----><habbo-tabs><nav ng-hide="TabsController.tabs.length < 2" class="tabs"><!----><div ng-click="TabsController.open = !TabsController.open" class="tabs__toggle"><div ng-class="{'tabs__toggle__title--active': TabsController.open}" class="tabs__toggle__title" translate="HOME_NEWS_TAB">Was ist neu</div></div><ul class="tabs__menu ng-hide" ng-hide="!TabsController.open" ng-transclude=""><habbo-tab path="/" strict-path="true" translation-key="HOME_NEWS_TAB"><li class="tab"><a ng-href="/" ng-class="{ 'tab__link--active': TabController.active }" class="tab__link tab__link--active" translate="HOME_NEWS_TAB" href="/">Was ist neu</a></li></habbo-tab><!----><habbo-tab habbo-require-session="" path="/messaging" translation-key="HOME_MESSAGING_TAB"><li class="tab"><a ng-href="/messaging" ng-class="{ 'tab__link--active': TabController.active }" class="tab__link" translate="HOME_MESSAGING_TAB" href="/messaging">Nachrichten</a></li></habbo-tab><!----></ul></nav></habbo-tabs><!----><main class="wrapper wrapper--content" ui-view=""><!----><habbo-moderation-notification habbo-require-session=""><!----></habbo-moderation-notification><!----><section><h1 translate="NEWS_TITLE">Aktuelle News</h1><div class="main main--fixed"><habbo-compile data="NewsController.promos"><section>
    <article class="news-header news-header--column">
        <a href="/community/article/25229/diesen-monat-das-festival-der-kunste" class="news-header__link news-header__banner">
            <figure class="news-header__viewport">
                <img src="https://images.habbo.com/web_images/habbo-web-articles/lpromo_fest19_gen-2.png" alt="Diesen Monat: Das Festival der Künste!" class="news-header__image news-header__image--featured">
                <img src="https://images.habbo.com/web_images/habbo-web-articles/lpromo_fest19_gen-2_thumb.png" alt="Diesen Monat: Das Festival der Künste!" class="news-header__image news-header__image--thumbnail">
            </figure>
        </a>
        <a href="/community/article/25229/diesen-monat-das-festival-der-kunste" class="news-header__link news-header__wrapper">
            <h2 class="news-header__title">Diesen Monat: Das Festival der Künste!</h2>
        </a>
        <aside class="news-header__wrapper news-header__info">
            <time class="news-header__date">03.06.2019</time>
            <ul class="news-header__categories">
                <li class="news-header__category">
                    <a href="/community/category/campaigns-activities" class="news-header__category__link" translate="NEWS_CATEGORY_CAMPAIGNS_ACTIVITIES">Kampagnen &amp; Aktivitäten</a>
                </li>
            </ul>
        </aside>
        <p class="news-header__wrapper news-header__summary">Tolle neue Kleidung im Künstlerstil, zu färbende Möbel, Schädel zum Sammeln und VIELES MEHR im Hotel zu unserem neuen Event! </p>
    </article>
    <article class="news-header news-header--column">
        <a href="/community/article/25320/habboevents-im-juni-3" class="news-header__link news-header__banner">
            <figure class="news-header__viewport">
                <img src="https://images.habbo.com/web_images/habbo-web-articles/lpromo_gen15_04.png" alt="HabboEvents im Juni" class="news-header__image news-header__image--featured">
                <img src="https://images.habbo.com/web_images/habbo-web-articles/lpromo_gen15_04_thumb.png" alt="HabboEvents im Juni" class="news-header__image news-header__image--thumbnail">
            </figure>
        </a>
        <a href="/community/article/25320/habboevents-im-juni-3" class="news-header__link news-header__wrapper">
            <h2 class="news-header__title">HabboEvents im Juni</h2>
        </a>
        <aside class="news-header__wrapper news-header__info">
            <time class="news-header__date">03.06.2019</time>
        </aside>
        <p class="news-header__wrapper news-header__summary">Hier findest du alle Events, die im Monat Juni stattfinden werden!</p>
    </article>
    <article class="news-header news-header--column">
        <a href="/community/article/25281/der-tempel-der-ahnen" class="news-header__link news-header__banner">
            <figure class="news-header__viewport">
                <img src="https://images.habbo.com/web_images/habbo-web-articles/lpromo_playhab_newDE.png" alt="Der Tempel der Ahnen" class="news-header__image news-header__image--featured">
                <img src="https://images.habbo.com/web_images/habbo-web-articles/lpromo_playhab_newDE_thumb.png" alt="Der Tempel der Ahnen" class="news-header__image news-header__image--thumbnail">
            </figure>
        </a>
        <a href="/community/article/25281/der-tempel-der-ahnen" class="news-header__link news-header__wrapper">
            <h2 class="news-header__title">Der Tempel der Ahnen</h2>
        </a>
        <aside class="news-header__wrapper news-header__info">
            <time class="news-header__date">02.06.2019</time>
            <ul class="news-header__categories">
                <li class="news-header__category">
                    <a href="/community/category/fansites" class="news-header__category__link" translate="NEWS_CATEGORY_FANSITES">Fanseiten</a>
                </li>
            </ul>
        </aside>
        <p class="news-header__wrapper news-header__summary">Die PlayHab Nachrichten Redaktion berichtet:</p>
    </article>
    <article class="news-header news-header--column">
        <a href="/community/article/25272/bewerbungsrunden-fur-juli-2" class="news-header__link news-header__banner">
            <figure class="news-header__viewport">
                <img src="https://images.habbo.com/web_images/habbo-web-articles/lpromo_gen15_66.png" alt="[HE] Bewerbungsrunden für Juli" class="news-header__image news-header__image--featured">
                <img src="https://images.habbo.com/web_images/habbo-web-articles/lpromo_gen15_66_thumb.png" alt="[HE] Bewerbungsrunden für Juli" class="news-header__image news-header__image--thumbnail">
            </figure>
        </a>
        <a href="/community/article/25272/bewerbungsrunden-fur-juli-2" class="news-header__link news-header__wrapper">
            <h2 class="news-header__title">[HE] Bewerbungsrunden für Juli</h2>
        </a>
        <aside class="news-header__wrapper news-header__info">
            <time class="news-header__date">31.05.2019</time>
        </aside>
        <p class="news-header__wrapper news-header__summary">Es ist Zeit, dein Event für die HabboEvents im Juli anzumelden.</p>
    </article>
    <article class="news-header news-header--column">
        <a href="/community/article/25278/botschafterprojekt-juni-2019" class="news-header__link news-header__banner">
            <figure class="news-header__viewport">
                <img src="https://images.habbo.com/web_images/habbo-web-articles/lpromo_gen_amb_1.png" alt="Botschafterprojekt Juni 2019" class="news-header__image news-header__image--featured">
                <img src="https://images.habbo.com/web_images/habbo-web-articles/lpromo_gen_amb_1_thumb.png" alt="Botschafterprojekt Juni 2019" class="news-header__image news-header__image--thumbnail">
            </figure>
        </a>
        <a href="/community/article/25278/botschafterprojekt-juni-2019" class="news-header__link news-header__wrapper">
            <h2 class="news-header__title">Botschafterprojekt Juni 2019</h2>
        </a>
        <aside class="news-header__wrapper news-header__info">
            <time class="news-header__date">30.05.2019</time>
            <ul class="news-header__categories">
                <li class="news-header__category">
                    <a href="/community/category/ambassadors" class="news-header__category__link" translate="NEWS_CATEGORY_AMBASSADORS">Botschafter</a>
                </li>
            </ul>
        </aside>
        <p class="news-header__wrapper news-header__summary">Botschafter Bewerbungsrunden</p>
    </article>
    <article class="news-header news-header--column">
        <a href="/community/article/25268/the-great-escape" class="news-header__link news-header__banner">
            <figure class="news-header__viewport">
                <img src="https://images.habbo.com/web_images/habbo-web-articles/HabboNews_Promo.png" alt="The Great Escape" class="news-header__image news-header__image--featured">
                <img src="https://images.habbo.com/web_images/habbo-web-articles/HabboNews_Promo_thumb.png" alt="The Great Escape" class="news-header__image news-header__image--thumbnail">
            </figure>
        </a>
        <a href="/community/article/25268/the-great-escape" class="news-header__link news-header__wrapper">
            <h2 class="news-header__title">The Great Escape</h2>
        </a>
        <aside class="news-header__wrapper news-header__info">
            <time class="news-header__date">25.05.2019</time>
            <ul class="news-header__categories">
                <li class="news-header__category">
                    <a href="/community/category/fansites" class="news-header__category__link" translate="NEWS_CATEGORY_FANSITES">Fanseiten</a>
                </li>
            </ul>
        </aside>
        <p class="news-header__wrapper news-header__summary">Gibt es ein Entkommen?</p>
    </article>
    ...

结果是没有javascript文件输出的源。 您是否有办法在所有javascript文件加载完结果后解析页面?

1 个答案:

答案 0 :(得分:0)

似乎不可能在客户端浏览器上执行某种页面内容抓取。您可以选择在服务器端执行的选项。抓取繁重的javascript网页通常需要我们的应用程序(在本例中为服务器端)来控制浏览器以首先通过等待超时时间来呈现完整的页面,然后读取呈现的内容以解析必要的信息。

  • 如果您更喜欢PHP,则可以选择Selenium及其PHP's driver
  • 或者,如果您更喜欢NodeJS上的Javascript,则有很多选择,但是this article可能是您的不错参考。他们指导使用puppeteer(控制浏览器来发送完整页面)和cheerio(轻松分析页面内容)的解决方案。