1👍
✅
You can rely on the class
attribute:
soup.find("div", class_="content")
Or, with a CSS selector:
soup.select_one("div.content")
If the content
class is not something uniquely identifying the element and you know the preceding “Interactive Elements” label:
import re
label = soup.find("div", class_="title", text=re.compile("Interactive Elements"))
print(label.find_next_sibling("div", class_="content"))
0👍
You can achive this in various waysL
1. document.querySelector('.content').innerHTML;
2. $('.content').text(); / $('.content').html();
3. soup.find("div", class_="content")
4. soup.select_one("div.content")
- Updating a field in table A only by insert operation in table B
- Values list vs Iterating
- Django render is very slow
- Making the first image select by default as featured from the modelformset_factory
Source:stackexchange.com