1.page_source爬取页面源码
from selenium import webdriver
import re
driver = webdriver.Chrome()
driver.get('https://www.cnblogs.com/canglongdao')
rs=driver.page_source.encode("utf-8")
link = re.findall('href="(.+?)"',str(rs))
list =[]
for i in link:
if 'http' in i:
list.append(i)
print(len(list),list)
借鉴 Selenium3+python3自动化(二十七)--爬页面源码(page_source) - 星空6 - 博客园
2.sort函数排列(从大到小)
items.sort(key=lambda x:x[1],reverse=True)