python 微博话题单独地址

发布时间 2023-04-30 06:35:12作者: myrj
import re,sys,time,os,requests
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium import webdriver
url="https://weibo.com/u/5861571226"
wd1 = webdriver.Chrome()
wd1.get(url)
wd1.set_page_load_timeout(20)
time.sleep(2)
content=wd1.page_source

ab=re.findall('<!----><!----><a title=".*?" href="(.*?)" class="head',content)

print(ab)