我想从一个站点(https://www.vanglaini.org/)收集链接:/hmarchhak/102217 并将其打印为https://www.vanglaini.org/hmarchhak/102217。请帮忙 看图
import requests
import pandas as pd
from bs4 import BeautifulSoup
source = requests.get('https://www.vanglaini.org/').text
soup = BeautifulSoup(source, 'lxml')
for article in soup.find_all('article'):
headline = article.a.text
summary=article.p.text
link = article.a.href
print(headline)
print(summary)
print(link)
print()
这是我的代码。
慕无忌1623718
相关分类