【发布时间】:2023-04-02 22:49:01
【问题描述】:
我正在使用 beautifulsoup 来获取页面中的所有链接。我的代码是:
import requests
from bs4 import BeautifulSoup
url = 'http://www.acontecaeventos.com.br/marketing-promocional-sao-paulo'
r = requests.get(url)
html_content = r.text
soup = BeautifulSoup(html_content, 'lxml')
soup.find_all('href')
我得到的只是:
[]
如何获得该页面上所有 href 链接的列表?
【问题讨论】:
标签: python web-scraping beautifulsoup html-parsing