I'm trying to count the number of tags in the 'soup' from a beautifulsoup result. I'd like to use a regular expression but am having trouble. The code Ive tried is as follows:
reg_exp_tag = re.compile("<[^>*>")
tags = re.findall(reg_exp_tag, soup(cast as a string))
but re
will not allow reg_exp_tag
, giving an unexpected end of regular expression error.
Any help would be much appreciated!
Thanks