When I was scraping and stumbled, I think that I often analyze elements with copy outer HTML
, but I forgot, so make a note
Python 2nd grade How scraping works Experience and understand! Learn in conversation!
Create a file with the copied HTML and read it
from bs4 import BeautifulSoup
with open('copy.html', encoding='utf-8') as f:
html = f.read()
soup = BeautifulSoup(html, 'html.parser')
Recommended Posts