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

我想通过 qq 群搜索的 url 进行模拟请求数据,但是总被发现,有啥好的解决办法??? 就是那种可以通过关键字进行群搜索的 url 方式

  •  
  •   Yycreater ·
    Yycreater · 2018-09-09 12:33:38 +08:00 · 2451 次点击
    这是一个创建于 2027 天前的主题,其中的信息可能已经有所发展或是发生改变。
    url = 'http://qun.qq.com/cgi-bin/group_search/pc_group_search'
    headers = {
    'Host': 'qun.qq.com',
    # 'Origin': 'http://find.qq.com',
    'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) QQ/9.0.5.23816 Chrome/43.0.2357.134 Safari/537.36 QBCore/3.43.915.400 QQBrowser/9.0.2524.400',
    'Referer': 'http://find.qq.com/index.html?version=1&im_version=5587&width=910&height=610&search_target=0',
    'Cookie': 'RK=YLIxpt7REk; pac_uid=1_873103889; pt2gguin=o0873103889; ptcz=d0740fb2969aed4db7ed5e45a4829fe21ea4920619e8f10b7d23ba3f3b07b270; pgv_info=ssid=s8595310324; pgv_pvid=976062120; p_skey=6mM1ueYPRqoXMRv9xzGuVYoxuLidDn4stptQXD-tfV4_; p_uin=o873103889; uin=o873103889; skey=Z62ZKb5JUl',
    }
    data = {
    'k': '%E4%BA%A4%E5%8F%8B',
    'n': '8',
    'st': '1',
    'iso': '1',
    'src': '1',
    'v': '5587',
    'bkn': '511199662',
    'isRecommend': 'false',
    'city_id': '0',
    'from': '1',
    'newSearch': 'true',
    'keyword': '%E8%89%BE%E6%96%AF%E5%A5%A5%E7%89%B9%E6%9B%BC',
    'sort': '0',
    'wantnum': '24',
    'page': '0',
    'ldw': '511199662'
    }
    res = requests.post(url=url, headers=headers, data=data)
    time.sleep(3)
    print(res.text)
    2 条回复    2018-09-09 14:08:09 +08:00
    49degree
        1
    49degree  
       2018-09-09 13:22:44 +08:00
    模拟浏览器点击
    Yycreater
        2
    Yycreater  
    OP
       2018-09-09 14:08:09 +08:00
    @49degree 桌面上的 QQ,不是网页上的。。。。。。。。。。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1124 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 22:56 · PVG 06:56 · LAX 15:56 · JFK 18:56
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.