Quand j'ai trébuché en faisant du scraping, je pense que j'analyse souvent des éléments avec copier du HTML externe, mais j'ai oublié
Mécanisme de raclage Python 2nd grade Expérience et compréhension! Apprenez en conversation!
Créez un fichier avec le HTML copié et lisez-le
from bs4 import BeautifulSoup
with open('copy.html', encoding='utf-8') as f:
html = f.read()
soup = BeautifulSoup(html, 'html.parser')
Recommended Posts