fork download
  1. from bs4 import BeautifulSoup
  2.  
  3. html = '''
  4. <html><head><title>Welcome to the Beans'R'Us Pricing Page</title>
  5.  
  6. <link rel="stylesheet" type="text/css" href="beansrus.css" />
  7.  
  8. </head><body>
  9.  
  10. <h2>Welcome to the Beans'R'Us Pricing Page</h2>
  11.  
  12. <p>Current price of coffee beans = <strong>$5.51</strong></p>
  13.  
  14. <p>Price valid for 15 minutes from Wed Mar 25 09:55:34 2015.</p>
  15.  
  16. </body></html>
  17. '''
  18.  
  19. print(BeautifulSoup(html).get_text())
Runtime error #stdin #stdout #stderr 0.02s 8736KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 1, in <module>
ImportError: No module named 'bs4'