January 2014
Beginner
130 pages
2h 37m
English
You can take a look at the following references to get an overview of the modifying content:
Tag name:The following code line modifies the name property:
tag.name = "newvalue": This line of code modifies the Tag name as newvalueTag attribute:The following code lines alter the attributes:
tag["attr"] = "newvalue": This line of code modifies the Tag attributedel tag["attr"]: This line of code deletes the Tag attributeThe following code lines correspond to the addition of content:
newtag = soup.new_tag('tagname'): This line of code creates newtagoldtag.append(newtag): This line of code appends newtag to oldtag.contentsoldtag.insert(0,newtag): This line of code inserts newtag at the index 0Read now
Unlock full access