Rafael Martins Rafael Martins - 1 year ago 73
HTML Question

HTML Scraping with BeautifulSoup

I'm trying to search


And pull out
. I've tried a lot of things but haven't been able to get it. Most recently
but that just returns
. There are a lot of things tagged with
in the HTML, but this is the only
after a

Edit: the HTML snipped above is a result of running
a = soup.find_all(attrs={'class':'vertical-offset-10 group-ib'})
then iterating over each loop with
a = (row.findChildren())

In the HTML:

<div class="vertical-offset-10 group-ib">

To clarify, all I want is the string

Answer Source
res = soup.find_all('span', text="Status:")

soup.find_all searches for all <span> tags that contain the text "Result:", then takes the next_sibling (the next <span> tag) and gets that tag's text contents.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download