如何下载此网址的来源?

时间:2019-07-28 11:38:33

标签: javascript selenium curl web-scraping phantomjs

我正在尝试下载https://outline.com/rUdmgC的源代码。 (我想获得与使用Chrome保存该网址时得到的文件相同的文件。)

我首先尝试了wget和curl,但是没有用。 (由于无法正常工作,我的意思是下载的源代码基本上是空的;该页面可能使用Javascript来创建其内容。)

然后我进行了一次谷歌搜索,并尝试了此https://gist.github.com/giocomai/247d54e097b5083e2451。它不起作用,并退出了这些异常:

TypeError: undefined is not a constructor (evaluating 'suffix.startsWith('http:')')

  https://outline.com/app.js:20767
  https://outline.com/app.js:17217
  https://outline.com/app.js:17113 in onEachEvent
  https://outline.com/app.js:17210 in value
  https://outline.com/app.js:18695
  https://outline.com/app.js:18792
  https://outline.com/app.js:19000 in each
  https://outline.com/app.js:18792 in toggle
  https://outline.com/app.js:18683
  https://outline.com/app.js:19498 in mountTo
  https://outline.com/app.js:19638 in pushTags
  https://outline.com/app.js:19000 in each
  https://outline.com/app.js:19642 in pushTags
  https://outline.com/app.js:19693 in mount
  https://outline.com/app.js:20112
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/" lang="en" class=" js csstransforms3d csstransitions" style=""><head>
        <title>Outline - Read &amp; annotate without distractions</title>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta http-equiv="content-type" content="text/html; charset=utf-8">
        <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no,height=device-height">
        <meta name="description" content="Outline is a free service for reading and annotating news articles. We remove the clutter so you can analyze and comment on the content.">
        <meta name="keywords" content="clean links readable readability medium typography annotations annotate">

        <link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/daoolpmoieinofbnddaofhkhmbagfmnj">



        <link rel="stylesheet" href="https://outline.com/css/outline.css?v=1.0.1">
        <link rel="shortcut icon" href="https://outline.com/favicon.png">

        <!--[if lte IE 8]><script src="js/html5shiv.js"></script><![endif]-->
        <script async="" src="https://www.google-analytics.com/analytics.js"></script><script src="https://outline.com/js/modernizr.custom.js"></script>
        <script src="https://outline.com/app.js"></script>

        <script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
        <script>
          (adsbygoogle = window.adsbygoogle || []).push({
            google_ad_client: "ca-pub-2748618594698147",
            enable_page_level_ads: true
          });
        </script>
    <style type="text/css">.yue { max-width: 650px; margin: 0 auto; }</style></head>
    <body>
        <outline-app></outline-app>
        <script>
            var riot = require('riot')
            require('initialize')
        </script>


</body></html>

我该怎么办?

1 个答案:

答案 0 :(得分:-1)

哦,是的。要查看结果页面,您应该在浏览器中打开页面并在开发人员模式下查看它。