I'm reading up on BeautifulSoup to screen-scrape some pretty heavy html pages. Going through the documentation of BeautifulSoup I can't seem to find a easy way to select child elements.
Given the html:
<div id="top">
<div>Content</div>
<div>
<div>Content I Want</div>
</div>
</div>
I want a easy way to to get the "Content I Want" given I have the object top. Coming to BeautifulSoup I thought it would be easy, and something like topobj.nodes[1].nodes[0].string. Instead I only see variables and functions that also return the elements together with text nodes, comments and so on.
Am I missing something? Or do I really need to resort to a long form using .find() or even worse using list comphrensions on the .contents variable.
The reason is that I don't trust the whitespace of the webpage to be the same so I want to ignore it and only traverse on elements.