首页 > 解决方案 > 如何在scrapy中跳过页面?

问题描述

Scrapy最近开始使用。

我在命令行中使用了下面的代码

scrapy shell https://website.com/portal/login

然后我在下面输入

 response.css('::text')

输出

[<Selector xpath='descendant-or-self::text()' data='Transferring to the website...'>, <Selector xpath='descendant-or-self::text()' data=' در ﺣﺎل اﻧﺘﻘﺎل ﺑﻪ ﺳﺎﯾﺖ ﻣﻮرد ﻧﻈﺮ ﻫﺴﺘﯿﺪ...'>, <Selector xpath='descendant-or-self::text()' data='var _this = this;\n\n  function _typeof...'>]

当我在登录页面出现之前使用Web浏览器(及以上带有scrapy的浏览器)时,会打开另一个带有transferring to the website...中心消息的页面。

我的问题是如何防止这种情况发生?如何跳过此加载页面,当我输入login urlinscrapy shell命令时,我得到登录页面而不是加载页面?

标签: pythonweb-scrapingscrapy

解决方案


推荐阅读