I'm trying to match a div tag that may look like:
I don't want to maths the other 1000 divs on the page
I know how to do it with selenium using xpath, but since I'm almost done with this app, and so far have done it all with BeautifulSoup, would
like to do this with soup as well.
I think I'm close, but no cigar yet.
the problem is matching an empty name field (and I want that empty field to be part of the match).
I have tried:
Output:<div id="" name="">
or it may look like Output:<a name="diddlysquat"></a>
orOutput:<a name="12358"></a>
Note second one doesn't have id, so can't use thatI don't want to maths the other 1000 divs on the page
I know how to do it with selenium using xpath, but since I'm almost done with this app, and so far have done it all with BeautifulSoup, would
like to do this with soup as well.
I think I'm close, but no cigar yet.
the problem is matching an empty name field (and I want that empty field to be part of the match).
I have tried:
divs = base_anchor.find_all("div", {"name" : re.compile('*')}) # or divs = base_anchor.find_all('div', name_=lambda s:s.startswith('')) # or divs = base_anchor.find_all('div', {'name: ''})all fail