摘要: rom bs4 import BeautifulSoup r = ''' <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>菜鸟教程(runoob.com) 40号的作业</title> </head> <body> <h1>我的 阅读全文
posted @ 2020-12-14 17:40 小C+ 阅读(73) 评论(0) 推荐(0) 编辑
摘要: mport requests url="https://www.shanghairanking.cn/" def gethtml(url): try: r=requests.get(url) r.raise_for_status() r.encoding="utf-8" print("text内容: 阅读全文
posted @ 2020-12-14 17:21 小C+ 阅读(42) 评论(0) 推荐(0) 编辑
摘要: import requests url="https://cn.bing.com/" def gethtml(url): try: r=requests.get(url) r.raise_for_status() r.encoding="utf-8" print("text内容:",r.text) 阅读全文
posted @ 2020-12-14 17:14 小C+ 阅读(48) 评论(0) 推荐(0) 编辑