Summary for myself Updated from time to time
** I just need to know myself, so the terms may be wrong in some places **
!! View
#command
#Argument option description
Parsing HTML and scraping
import bs4
#Get object for analysis
soup = bs4.BeutifulSoup()
#HTML object as the first argument → webdriver.get_The one that can be taken with source
#HTML parser as second argument
#→ Typical lxml,html5lib,html.parser
#Find one in element information
element = soup.find()
class= #name of the class
href= #Link
"" #Tab if nothing is attached
#Find all in element information
element = soup.find_all()
#The argument is find()Same as
#If there are multiple values, the return value is a list
#Find everything with css selector
element = soup.select()
#Only the text part of the found element
element.string
Recommended Posts