Python开发:正则表达式获得URL
来源:互联网 发布:淘宝上面买东西没发票 编辑:程序博客网 时间:2024/05/16 11:50
用正则表达式获得a标签中的链接地址
import urllib2
from BeautifulSoup import BeautifulSoupimport re
fp = urllib2.urlopen('http://www.baidu.com')
soup = BeautifulSoup(fp)
p=re.compile(r'<a.*?href=["\'](.*?)["\']+')
for m in re.findall(p,str(soup)):
print m,'\n'
- Python开发:正则表达式获得URL
- Python 正则表达式验证URL
- PYTHON 开发 正则表达式
- python 正则表达式判断URL是否合法
- python+正则表达式获取ed2k url
- Python 正则表达式在文本查询URL
- Python 正则表达式验证generic url
- Python 正则表达式提取URL中的Scheme
- Python 正则表达式提取URL中的USER
- Python 正则表达式提取URL中的Host
- Python 正则表达式提取URL中Port
- Python 正则表达式提取URL中的Path
- Python 正则表达式提取URL中的Query
- Python 正则表达式提取URL中的Fragment
- python+正则表达式获取ed2k url
- python使用正则表达式解析http url
- 获得URL的正则。
- 正则表达式的获得
- 装箱和拆箱的基本原理
- java 开源网站
- Android Notes 02 - AIDL
- HMM学习2之前向-后向算法(转)
- 开发基于Google Map的Android应用
- Python开发:正则表达式获得URL
- 修改redhat启动级别
- Android Notes 04 - Intents and Intent Filters
- vba 导入 TXT 到 access
- Twister运行Kmeans
- Android Notes 05 - Tasks and Back Stack
- 算法学习笔记----最长公共子序列问题
- 快速找到被占端口进程8080
- php对mysql的基本操作