怎么使用python获取网站的子链接
答案:1 悬赏:70
解决时间 2021-01-20 15:36
- 提问者网友:情歌越听越心酸
- 2021-01-20 06:19
怎么使用python获取网站的子链接
最佳答案
- 二级知识专家网友:夜余生
- 2021-01-20 07:12
可以使用urllib
import urllib
response=urllib.urlopen("网站地址")
page=response.read()
pos=page.find("while ~pos:
page=page[pos+9:]
lim=page.find('"')
print "You've found a link:%s"%page[:lim]
pos=page.find("
import urllib
response=urllib.urlopen("网站地址")
page=response.read()
pos=page.find("while ~pos:
page=page[pos+9:]
lim=page.find('"')
print "You've found a link:%s"%page[:lim]
pos=page.find("
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯