Oct-14-2022, 07:48 AM
Look at a in:
Dunno what that is, but is not a string and probably that's why you can't .strip() it: no string.
snippsat is the guy to ask with bs4 but I got this from here and saved it:
for a in soup.find_all("h3"): job_heading.append(a.string.strip())If you look at type(a) you get:
Quote:>>> type(a)
<class 'bs4.element.Tag'>
Dunno what that is, but is not a string and probably that's why you can't .strip() it: no string.
snippsat is the guy to ask with bs4 but I got this from here and saved it:
# Can be a list of tags # tags = ['h3'] # for tags in soup.find_all(tags): for tags in soup.find_all('h3'): print(tags.text.strip()) # or like this for tags in soup.find_all('span'): print(tags.text.strip())