摘要: 一、基本语法 二、re库 三、更多见Python之正则表达式 https://i.cnblogs.com/posts?cateId=1775942 阅读全文
posted @ 2020-06-05 21:43 udbful 阅读(171) 评论(0) 推荐(0)
摘要: 一、功能描述及程序设计 二、代码实现 1 """中国大学排名定向爬虫实例介绍""" 2 3 import requests 4 from bs4 import BeautifulSoup 5 import bs4 6 7 8 def getHTMLTest(url): 9 10 try: 11 r 阅读全文
posted @ 2020-06-05 20:42 udbful 阅读(228) 评论(0) 推荐(0)
摘要: 一、对find_all()方法举例 """基于bs4库的HTML内容查找方法""" import requests from bs4 import BeautifulSoup import re url = "https://python123.io/ws/demo.html" r = reques 阅读全文
posted @ 2020-06-05 16:13 udbful 阅读(309) 评论(0) 推荐(0)
摘要: """信息提取的一般方法""" import requests from bs4 import BeautifulSoup url = "https://python123.io/ws/demo.html" r = requests.get(url) demo = r.text soup = Bea 阅读全文
posted @ 2020-06-05 00:50 udbful 阅读(159) 评论(0) 推荐(0)
摘要: 一、格式化主要用prettify()方法 """基于bs4库的HTML格式化""" import requests from bs4 import BeautifulSoup #方法一:下行遍历 url = "https://python123.io/ws/demo.html" r = reques 阅读全文
posted @ 2020-06-05 00:17 udbful 阅读(287) 评论(0) 推荐(0)