![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python学习
wukong_666
这个作者很懒,什么都没留下…
展开
-
python html抓取,并用re正则表达式解析(一)
html抓取,并用re进行解析 #coding=utf-8 import urllib.request import re ''' url :"http://money.163.com/special/pinglun/" 抓取第一页的新闻信息,并按照以下规格输出。 [ {'title':'生鲜电商为何难盈利?','created_at':'2013-05-03 08:43','url':...原创 2018-11-16 22:29:39 · 11977 阅读 · 0 评论 -
python html抓取,并用re正则表达式解析(二)
需求: url: “http://search.jd.com/Search?keyword=幼猫猫粮&enc=utf-8#filter” 给出一个jd_search(keyword)方法,keyword为你要查找的东西,比如:猫粮、手机,替换上面url中的keyword,得到一个新网页。用正则表达式解析此网页,得到每个物品的图片、标题、价格、链接,组成一个字典,最后将所有物品的信息放在一个...原创 2018-11-17 14:00:20 · 1943 阅读 · 0 评论 -
python html抓取,并用BeautifulSoup解析(一)
在文章《python html抓取,并用re正则表达式解析(一)》中,用的是re正则表达式提取相应的内容,本次引入BeautifulSoup进行提取。 #coding=utf-8 ''' 作业1: url :"http://money.163.com/special/pinglun/" 抓取第一页的新闻信息,并按照以下规格输出。 [ {'title':'生鲜电商为何难盈利?','crea...原创 2018-11-18 16:46:58 · 1134 阅读 · 0 评论 -
python html抓取多页数据,并用re解析(二)
#!/usr/bin/env python3 #-*- coding: utf-8 -*- import urllib.request import re ''' url = "http://search.jd.com/Search?keyword=%E5%B9%BC%E7%8C%AB%E7%8C%AB%E7%B2%AE&enc=utf-8#filter" print jd_sear...原创 2018-12-18 17:18:39 · 1705 阅读 · 0 评论