推荐学习书目
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
ITheihu
V2EX  ›  Python

Python +selenium 爬虫遇到诡异反扒

  •  
  •   ITheihu · Oct 12, 2019 · 4785 views
    This topic created in 2429 days ago, the information mentioned may be changed or developed.

    不同的账号登入同一个网址,登陆进去后标签的 id 属性值自动改变,怎么做到批量爬取。(不然一个程序只能爬一个账号,换个账号因为 id 属性值的改变就无法爬取) 头都大了......!

    15 replies    2019-10-12 18:50:29 +08:00
    kran
        1
    kran  
       Oct 12, 2019 via Android
    结构不变就用标签?
    yidinghe
        2
    yidinghe  
       Oct 12, 2019   ❤️ 1
    可能前端纯粹是为了方便把用户 ID 拼到里面,没想到成了反扒手段
    Hopetree
        3
    Hopetree  
       Oct 12, 2019   ❤️ 1
    重要的是结构,不是 ID,这种根本不能算反爬,你为啥非要用 ID 去定位?? xpath 选择器,selecter 选择器哪个限定了只能用 ID 吗
    nullboy
        4
    nullboy  
       Oct 12, 2019
    楼上+1
    linvaux
        5
    linvaux  
       Oct 12, 2019 via Android
    楼上已经给出答案了
    ClericPy
        6
    ClericPy  
       Oct 12, 2019
    这太难猜了, 给个 HTML 例子让人测测选择器也好啊
    ITheihu
        7
    ITheihu  
    OP
       Oct 12, 2019
    不知道怎么描述!全网站禁止右键功能,层层都有 iframe,头大啊
    cwjokaka
        8
    cwjokaka  
       Oct 12, 2019
    不用 id 选择就行了啊
    crab
        9
    crab  
       Oct 12, 2019
    正则,或者找出账号和 id 关系。
    Rubbly
        10
    Rubbly  
       Oct 12, 2019
    这根本不算反爬+1.
    禁止右键,但是查看源代码的方法有很多啊。F12 或者先开一个 DevTool window 再导航过去或者油猴弄个脚本都能解决的。
    dji38838c
        11
    dji38838c  
       Oct 12, 2019
    标题党呀,这算什么“诡异反扒”

    看标题,期待的是:网站把你本机给爬了,那才叫做真“诡异”
    Juszoe
        12
    Juszoe  
       Oct 12, 2019
    楼主技术不过关啊,禁止右键都绕不过
    515576745
        13
    515576745  
       Oct 12, 2019 via Android
    技术问题吧, 练多就好了
    inoizyz
        14
    inoizyz  
       Oct 12, 2019 via Android
    1.这网页不是我做的。
    2.我经常干这事,偷懒不用 cookie。
    3.我不是前端。
    locoz
        15
    locoz  
       Oct 12, 2019
    根本算不上问题的问题...结合早上那个贴子看效果更佳 水文太多了,小白连这么基础的东西都没搞清楚。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   878 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 50ms · UTC 20:45 · PVG 04:45 · LAX 13:45 · JFK 16:45
    ♥ Do have faith in what you're doing.