无法将Beautifulsoup与python3一起使用,但是该元素存在于HTML中

时间:2019-01-14 09:22:16

标签: python-3.x beautifulsoup

html = """<div class="sf_main_content tp">
                        <div><img class="fullwidth" src="https://www.naval-technology.com/wp-content/uploads/static-progressive/nri/aerospace/clients/UEI/banner.jpg" alt="UEI banner" width="800" /></div>
<p>United Electronic Industries (UEI) provides solutions for a wide range of military data acquisition, monitoring and control applications.</p>
<p>The company&#8217;s products are designed to handle adverse environmental conditions, conforming to MIL-STD-810, MIL-STD-461 and MIL-STD-1275 requirements of temperatures from 40°C to 85°C, shock to 100G, and vibration to 5G respectively.</p>
"""

代码:

soup = BeautifulSoup(html,'lxml')
print(soup.find(class_ = 'sf_main_content tp'))

输出:None

0 个答案:

没有答案