这是一个创建于 3264 天前的主题,其中的信息可能已经有所发展或是发生改变。
目的是爬取 360 某站全部用户名!
我写出了!提取指定 ID 的!怎么循环啊~
# -*- coding:utf-8 -*-
import re
import urllib2
import urlparse
url = '25911'
pj = urlparse.urljoin('http://security.360.cn/User/userInfo/uid/',url)
page = urllib2.urlopen(pj)
html = page.read()
p = re.compile(r'<span\s*class="w100">(.+?)</span>')
print p.findall(html)
|
|
1
nerozhu 2015-10-25 23:09:56 +08:00
试试 BeautifulSoup 吧
|
|
|
2
master13 2015-10-27 09:14:31 +08:00
并没有看懂问题……
|