How to find a specific div by calling soup attributes? those. something like soup.html.body.div , however I donβt see how you can get a specific div with id='idname' ?
I can do soup.findAll(id='idname')[0] to get a specific tag, but as I understand it, this is a search for the whole soup.
I assume getting the div attribute over the soup will be faster since you are not using findAll() ?
Firebug reports the location as html.body.div[2].form.table[2].tbody.tr[3]... however executing soup.html.body.div[2] gives a key error.
Update:
Say you want to grab the button , I'm in luck , http://www.google.com , tells firebug that the quality are:
/html/body/center/span/center/div[2]/form/div[2]/div[3]/center/input[2]
Is there a way to achieve this without using findAll ?
source share