📌  相关文章
📜  使用 beautifulsoup 获取网站内容 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:29.968000             🧑  作者: Mango

代码示例1
from bs4 import BeautifulSoup
import requests
    
URL = 'https://google.com/'
content = requests.get(URL)
soup = BeautifulSoup(content.text, 'html.parser')

print(soup.text)

#This code will print the website content of google
#You can change the website by editing the URL inside the variable named 'URL'