我想使用此网站https://www.eduvision.edu.pk/institutions-detail.php?city=51I&institute=1310738526_national-defence-university-islamabad的类名=“ fixText”来刮除div中的锚标记的href,但无法获取完整的href文本。请帮帮我。
我只有一半的href
“ institutions-detail.php?city = 51I&institute = 721_institute-of-space-technology-islamabad”
import requests
from bs4 import BeautifulSoup
from fake_useragent import UserAgent
ua = UserAgent()
header = {'user-agent':ua.chrome}
response = requests.get('https://www.eduvision.edu.pk/institutions-detail.php?city=51I&institute=1310738526_national-defence-university-islamabad',headers=header)
soup = BeautifulSoup(response.content, 'html.parser')
for i in soup.find_all('div', attrs={'class' : 'fixText'}):
print(i.a['href'])