【发布时间】:2023-04-05 16:53:02
【问题描述】:
我需要从 match_items 获取所有 href,我的代码:
url_news = "https://www.hltv.org/matches"
response = requests.get(url_news)
soup = BeautifulSoup(response.content, "html.parser")
match_info = []
match_items = soup.find("div", class_="upcomingMatchesSection")
match_info.append(match_items.findAll("a", class_="match a-reset", href=True).item['href'])```
【问题讨论】:
标签: python parsing beautifulsoup href