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

python 爬虫中怎么搜索中文字符?

  •  
  •   lzy4223 · 2014-03-26 09:50:16 +08:00 · 4747 次点击
    这是一个创建于 3656 天前的主题,其中的信息可能已经有所发展或是发生改变。
    正下联系爬虫,例如我要爬zhibo8.com上,有“切尔西”三个子的连接爬下来,我在正则表达式里面可以输入中文吗?
    est
        1
    est  
       2014-03-26 09:53:18 +08:00   ❤️ 1
    你自己用python代码试一试的源码长度都比你这个问题打的字少。
    linuxer
        2
    linuxer  
       2014-03-26 09:58:03 +08:00
    噗,百度知道既视感。
    lzy4223
        3
    lzy4223  
    OP
       2014-03-26 10:03:02 +08:00
    @linuxer
    @est

    在网上一直没看到用中文的例子,以为是不可以,要用什么特别的方法。

    好吧,忽略我把。
    paulw54jrn
        4
    paulw54jrn  
       2014-03-26 10:04:04 +08:00   ❤️ 1
    根据实战经验是可以的
    raw_next_url = re.findall(u'<span class="zg-gray-normal">下一页</span>',raw_data)
    paulw54jrn
        5
    paulw54jrn  
       2014-03-26 10:04:37 +08:00   ❤️ 1
    以前爬知乎时候的代码..
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5405 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 07:52 · PVG 15:52 · LAX 00:52 · JFK 03:52
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.