摘要: #encoding: utf-8 import re # 分组 text = "apple's price $99,orange's price is $10" ret = re.search('.*(\$\d+).*(\$\d+)',text) print(ret.group(0)) # ret. 阅读全文
posted @ 2020-03-13 11:34 胡辣汤王子 阅读(206) 评论(0) 推荐(0) 编辑
摘要: #encoding: utf-8 import re text = "apple price is $299" ret = re.search("\$\d+",text) print(ret.group()) # r = raw = 原生的 # text = '\n' # print(text) t 阅读全文
posted @ 2020-03-13 11:32 胡辣汤王子 阅读(388) 评论(0) 推荐(0) 编辑
摘要: import re # 1. 匹配某个字符串: text = "hello" ret = re.match('he',text) print(ret.group()) # 2. 点:匹配任意的字符 text = "\n" ret = re.match('.',text) print(ret.grou 阅读全文
posted @ 2020-03-13 11:31 胡辣汤王子 阅读(282) 评论(0) 推荐(0) 编辑
摘要: from bs4 import BeautifulSoup import requests from pyecharts import Bar headers={ "User-Agent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.3 阅读全文
posted @ 2020-03-13 11:28 胡辣汤王子 阅读(266) 评论(0) 推荐(0) 编辑
摘要: from bs4 import BeautifulSoup html=""" <html> <head> <title>表格标签学习</title> <meta charset="UTF-8"/> <pre> 表格标签学习: table :声明一个表格 tr:声明一行,设置行高及改行所有单元格的高度 阅读全文
posted @ 2020-03-13 11:27 胡辣汤王子 阅读(231) 评论(0) 推荐(0) 编辑
摘要: from bs4 import BeautifulSoup html=""" <html> <head> <title>表格标签学习</title> <meta charset="UTF-8"/> <pre> 表格标签学习: table :声明一个表格 tr:声明一行,设置行高及改行所有单元格的高度 阅读全文
posted @ 2020-03-13 11:25 胡辣汤王子 阅读(142) 评论(0) 推荐(0) 编辑