请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

scrapy shell 跳转到另外的页面了

输入的是 http://www.jwc.shu.edu.cn/Default.aspx?tabid=23168&ctl=Detail&mid=43516&Id=231393

但是却get到的是 http://www.jwc.shu.edu.cn/Default.aspx?tabid=23168

log里也没有写转向标志

E:\Amo\SHUSpider>scrapy shell http://www.jwc.shu.edu.cn/Default.aspx?tabid=23168&ctl=Detail&mid=43516&Id=231393
2018-08-06 17:25:24 [scrapy.utils.log] INFO: Scrapy 1.5.0 started (bot: SHUSpider)
2018-08-06 17:25:24 [scrapy.utils.log] INFO: Versions: lxml 4.2.1.0, libxml2 2.9.8, cssselect 1.0.3, parsel 1.4.0, w3lib 1.
19.0, Twisted 17.5.0, Python 3.6.5 |Anaconda custom (64-bit)| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)],
 pyOpenSSL 18.0.0 (OpenSSL 1.0.2o  27 Mar 2018), cryptography 2.2.2, Platform Windows-10-10.0.16299-SP0
2018-08-06 17:25:24 [scrapy.crawler] INFO: Overridden settings: {'BOT_NAME': 'SHUSpider', 'DUPEFILTER_CLASS': 'scrapy.dupef
ilters.BaseDupeFilter', 'LOGSTATS_INTERVAL': 0, 'NEWSPIDER_MODULE': 'SHUSpider.spiders', 'SPIDER_MODULES': ['SHUSpider.spid
ers']}
2018-08-06 17:25:24 [scrapy.middleware] INFO: Enabled extensions:
['scrapy.extensions.corestats.CoreStats',
 'scrapy.extensions.telnet.TelnetConsole']
2018-08-06 17:25:24 [scrapy.middleware] INFO: Enabled downloader middlewares:
['scrapy.downloadermiddlewares.httpauth.HttpAuthMiddleware',
 'scrapy.downloadermiddlewares.downloadtimeout.DownloadTimeoutMiddleware',
 'scrapy.downloadermiddlewares.defaultheaders.DefaultHeadersMiddleware',
 'scrapy.downloadermiddlewares.useragent.UserAgentMiddleware',
 'scrapy.downloadermiddlewares.retry.RetryMiddleware',
 'scrapy.downloadermiddlewares.redirect.MetaRefreshMiddleware',
 'scrapy.downloadermiddlewares.httpcompression.HttpCompressionMiddleware',
 'scrapy.downloadermiddlewares.redirect.RedirectMiddleware',
 'scrapy.downloadermiddlewares.cookies.CookiesMiddleware',
 'scrapy.downloadermiddlewares.httpproxy.HttpProxyMiddleware',
 'scrapy.downloadermiddlewares.stats.DownloaderStats']
2018-08-06 17:25:24 [scrapy.middleware] INFO: Enabled spider middlewares:
['scrapy.spidermiddlewares.httperror.HttpErrorMiddleware',
 'scrapy.spidermiddlewares.offsite.OffsiteMiddleware',
 'scrapy.spidermiddlewares.referer.RefererMiddleware',
 'scrapy.spidermiddlewares.urllength.UrlLengthMiddleware',
 'scrapy.spidermiddlewares.depth.DepthMiddleware']
2018-08-06 17:25:24 [scrapy.middleware] INFO: Enabled item pipelines:
['SHUSpider.pipelines.ShuspiderPipeline',
 'SHUSpider.pipelines.MysqlTwistedPipeline']
2018-08-06 17:25:24 [scrapy.extensions.telnet] DEBUG: Telnet console listening on 127.0.0.1:6023
2018-08-06 17:25:24 [scrapy.core.engine] INFO: Spider opened
2018-08-06 17:25:25 [scrapy.core.engine] DEBUG: Crawled (200) <GET http://www.jwc.shu.edu.cn/Default.aspx?tabid=23168> (ref
erer: None)
[s] Available Scrapy objects:
[s]   scrapy     scrapy module (contains scrapy.Request, scrapy.Selector, etc)
[s]   crawler    <scrapy.crawler.Crawler object at 0x0000021A3460AC18>
[s]   item       {}
[s]   request    <GET http://www.jwc.shu.edu.cn/Default.aspx?tabid=23168>
[s]   response   <200 http://www.jwc.shu.edu.cn/Default.aspx?tabid=23168>
[s]   settings   <scrapy.settings.Settings object at 0x0000021A36DB0898>
[s]   spider     <JwcSpider 'jwc' at 0x21a37139470>



正在回答 回答被采纳积分+3

1回答

提问者 Amo_u 2018-08-08 01:28:10

已解决 是被重定向了 感觉没认真听课 明明老师有讲设置redirect

=。=

在scrapy shell中用fetch 再设置redirect=False就好啦


0 回复 有任何疑惑可以回复我~
  • 登录成功后跳转到 选择地区的页面了 https://www.lagou.com/?msg=validation&uStatus
    
    
    请问怎么解决的
    回复 有任何疑惑可以回复我~ 2018-08-08 03:59:30
  • bobby #2
    好的,
    回复 有任何疑惑可以回复我~ 2018-08-08 11:30:38
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信