频道栏目
首页 > 资讯 > Python > 正文

python test0729.py

13-08-07        来源:[db:作者]  
收藏   我要投稿
#!/usr/env  python
#-*- coding: utf-8  -*-
import urllib 
import urllib2 
import random 
import requests
import os,sys 
import MySQLdb
from BeautifulSoup import BeautifulSoup
from sgmllib import SGMLParser 
import re
def main():
	t="https://play.google.com/store/apps/category/PERSONALIZATION"
			
	html=requests.get(t)
	result=html.content
	
	
	print type(result)
	soup=BeautifulSoup(result)
	temp=soup.prettify("utf-8")
	pattern=re.compile('<a class="title" href="(.+?)" title')
	dataresult=re.findall(pattern,temp)
	print dataresult
	print len(dataresult)
	print type(temp)
	f=file("hello.txt","w+")
	f.writelines(temp)
	f.close()
if  __name__=="__main__":
       main()

 

相关TAG标签
上一篇:画矩形
下一篇:Windows 7中Telnet功能安装与测试
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站