我是一名退休的程序员,但不熟悉scrapy。实际上,这是我的第一个 python 项目,所以我可能做错了什么。
我在 anaconda 下提出了 scrapy 并使用以下命令启动了一个 shell:
scrapy shell "https://sailing-channels.com/by-subscribers"
看起来一切正常,我可以进行一些查询。
这是我的问题:当我输入时:
response.css('body').extract()
我得到:['<body><noscript>If you\'re seeing this message, that means <strong>JavaScript has been disabled on your browser</strong>, please <strong>enable JS</strong> to make this app work.</noscript><div id="app"></div><script src="//apis.google.com/js/platform.js" async></script><script>!function(e,a,n,t,g,c,i){e.GoogleAnalyticsObject="ga",e.ga=e.ga||function(){(e.ga.q=e.ga.q||[]).push(arguments)},e.ga.l=1*new Date,c=a.createElement(n),i=a.getElementsByTagName(n)[0],c.async=1,c.src="//www.google-analytics.com/analytics.js",i.parentNode.insertBefore(c,i)}(window,document,"script"),ga("create","UA-15981085-17","auto"),ga("require","linkid"),ga("set","anonymizeIp",!0),ga("send","pageview")</script><script type="application/ld+json">{\n\t\t\t"@context": "http://schema.org",\n\t\t\t"@type": "Organization",\n\t\t\t"name": "Sailing Channels"\n\t\t\t"url": "https://www.sailing-channels.com",\n\t\t\t"logo": "https://sailing-channels.com/img/banner.png",\n\t\t\t"sameAs" : [\n\t\t\t\t"https://www.facebook.com/sailingchannels",\n\t\t\t\t"https://twitter.com/sailchannels"\n\t\t\t]\n\t }</script><script type="text/javascript" src="https://cdn.sailing-channels.com/1.15.9/main.1dad65fcb7a507930e1f.js"></script></body>']
我的问题是我期望更多。当我对 chrome 进行检查时,我看到里面有更多的 /div 部分<div id="app"></div>
有人可以阐明我做错了什么吗?我想抓取频道名称、订阅人数和观看次数
肥皂起泡泡
相关分类