import requests # 伪造浏览器发起http请求 from bs4 import BeautifulSoup ''' 将html格式的字符串解析成对象,通过对戏.find .find_all 查找 https://github.com/settings/profile ''' response = requests.get("https://github.com/login") response.encoding="gbk" print(response.text)