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
redhatping
V2EX  ›  Python

javascript 分页问题下的爬虫思路怎么解决?

  •  
  •   redhatping · 2016-07-20 15:10:03 +08:00 · 2515 次点击
    这是一个创建于 2842 天前的主题,其中的信息可能已经有所发展或是发生改变。
    主页面:http://www.smeimdf.org.cn/news/notify.jsp?searchType=1
    爬虫目标: 查询各个地区的企业.

    遇到的问题:

    1,无论查询什么,生成的页面都是: http://www.smeimdf.org.cn/news/searchEntpAudit.jsp (链接中没有参数),
    爬虫如何抓取呢

    2.查询后的页面-- 如 javascript 下的分页.
    爬虫怎么抓取呢
    6 条回复    2016-07-21 11:21:10 +08:00
    3dwelcome
        1
    3dwelcome  
       2016-07-20 15:25:05 +08:00 via Android
    看了下、是 form post 提交、改一下页面 id 就可以了吧。
    lxy
        2
    lxy  
       2016-07-20 15:28:43 +08:00   ❤️ 1
    post 提交,页数参数应该是 cpf.cpage 。浏览器按 F12 看一下请求的地址和提交的内容。
    redhatping
        3
    redhatping  
    OP
       2016-07-20 15:32:38 +08:00
    @3dwelcome 1. ( 网站数据 POST 提交-- 数据库查询--生成页面),抓取 POST action="searchEntpAudit.jsp" 就可以了嘛?

    2. 分页怎么办呢?
    redhatping
        4
    redhatping  
    OP
       2016-07-20 15:33:31 +08:00
    @lxy 好的, 我抓取看看,谢谢.
    miaotaizi
        5
    miaotaizi  
       2016-07-21 09:02:32 +08:00
    他页面上不有分页信息么, 这都做不到?
    ZnZt
        6
    ZnZt  
       2016-07-21 11:21:10 +08:00
    直接抓接口数据
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1104 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 23:55 · PVG 07:55 · LAX 16:55 · JFK 19:55
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.