V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
xiushenbuhuihui
V2EX  ›  Python

crawlspider 爬取全网站原网站信息不全,目前怀疑主要是相对链接没有被转化为绝对链接

  •  
  •   xiushenbuhuihui · 2019-06-14 11:24:58 +08:00 · 983 次点击
    这是一个创建于 1771 天前的主题,其中的信息可能已经有所发展或是发生改变。
    您好,我把我的问题给你详细描述一下,请您帮我解决一下。
    用的是 crawlspider 爬取乐融商城全部的网站源代码,但是爬取到精选配件页面(全部分类选项里面)时,由于商品(“比如:乐视蓝牙耳机”)的链接只是相对的,结果导致无法爬取商品页面源代码
    z1421012325
        1
    z1421012325  
       2019-06-17 00:32:26 +08:00
    scrapy 框架的话有个方法 response.urljoin(你提取出来的链接) 可以补全
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2797 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 13:08 · PVG 21:08 · LAX 06:08 · JFK 09:08
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.