In [18]:
import urllib2
from bs4 import BeautifulSoup
In [26]:
url = 'http://python.org'
def get_site_html(url):
source = urllib2.urlopen(url).read()
return source
source = get_site_html(url)
'Python' in source
Out[26]:
True
In [27]:
source = get_site_html(url)
tree = BeautifulSoup(source)
tree
Out[27]:
<!DOCTYPE html>\n<!--[if lt IE 7]> <html class="no-js ie6 lt-ie7 lt-ie8 lt-ie9"> <![endif]--><!--[if IE 7]> <html class="no-js ie7 lt-ie8 lt-ie9"> <![endif]--><!--[if IE 8]> <html class="no-js ie8 lt-ie9"> <![endif]--><!--[if gt IE 8]><!--><html class="no-js" dir="ltr" lang="en"> <!--<![endif]-->\n<head>\n<meta charset="unicode-escape"/>\n<meta content="IE=edge" http-equiv="X-UA-Compatible"/>\n<link href="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" rel="prefetch"/>\n<meta content="Python.org" name="application-name"/>\n<meta content="The official home of the Python Programming Language" name="msapplication-tooltip"/>\n<meta content="Python.org" name="apple-mobile-web-app-title"/>\n<meta content="yes" name="apple-mobile-web-app-capable"/>\n<meta content="black" name="apple-mobile-web-app-status-bar-style"/>\n<meta content="width=device-width, initial-scale=1.0" name="viewport"/>\n<meta content="True" name="HandheldFriendly"/>\n<meta content="telephone=no" name="format-detection"/>\n<meta content="on" http-equiv="cleartype"/>\n<meta content="false" http-equiv="imagetoolbar"/>\n<script src="/static/js/libs/modernizr.js"></script>\n<link href="/static/stylesheets/style.css" rel="stylesheet" title="default" type="text/css"/>\n<link href="/static/stylesheets/mq.css" media="not print, braille, embossed, speech, tty" rel="stylesheet" type="text/css"/>\n<!--[if (lte IE 8)&(!IEMobile)]>\n <link href="/static/stylesheets/no-mq.css" rel="stylesheet" type="text/css" media="screen" />\n \n \n <![endif]-->\n<link href="/static/favicon.ico" rel="icon" type="image/x-icon"/>\n<link href="/static/apple-touch-icon-144x144-precomposed.png" rel="apple-touch-icon-precomposed" sizes="144x144"/>\n<link href="/static/apple-touch-icon-114x114-precomposed.png" rel="apple-touch-icon-precomposed" sizes="114x114"/>\n<link href="/static/apple-touch-icon-72x72-precomposed.png" rel="apple-touch-icon-precomposed" sizes="72x72"/>\n<link href="/static/apple-touch-icon-precomposed.png" rel="apple-touch-icon-precomposed"/>\n<link href="/static/apple-touch-icon-precomposed.png" rel="apple-touch-icon"/>\n<meta content="/static/metro-icon-144x144-precomposed.png" name="msapplication-TileImage"/><!-- white shape -->\n<meta content="#3673a5" name="msapplication-TileColor"/><!-- python blue -->\n<meta content="#3673a5" name="msapplication-navbutton-color"/>\n<title>Welcome to Python.org</title>\n<meta content="The official home of the Python Programming Language" name="description"/>\n<meta content="Python programming language object oriented web free open source software license documentation download community" name="keywords"/>\n<meta content="website" property="og:type"/>\n<meta content="Python.org" property="og:site_name"/>\n<meta content="Welcome to Python.org" property="og:title"/>\n<meta content="The official home of the Python Programming Language" property="og:description"/>\n<meta content="https://www.python.org/static/opengraph-icon-200x200.png" property="og:image"/>\n<meta content="https://www.python.org/static/opengraph-icon-200x200.png" property="og:image:secure_url"/>\n<meta content="https://www.python.org/" property="og:url"/>\n<link href="/static/humans.txt" rel="author"/>\n<script type="application/ld+json">\n {\n "@context": "http://schema.org",\n "@type": "WebSite",\n "url": "https://www.python.org/",\n "potentialAction": {\n "@type": "SearchAction",\n "target": "https://www.python.org/search/?q={search_term_string}",\n "query-input": "required name=search_term_string"\n }\n }\n </script>\n<script type="text/javascript">\n var _gaq = _gaq || [];\n _gaq.push(['_setAccount', 'UA-39055973-1']);\n _gaq.push(['_trackPageview']);\n\n (function() {\n var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n })();\n </script>\n</head>\n<body class="python home" id="homepage">\n<div id="touchnav-wrapper">\n<div class="do-not-print" id="nojs">\n<p><strong>Notice:</strong> While Javascript is not essential for this website, your interaction with the content will be limited. Please turn Javascript on for the full experience. </p>\n</div>\n<!--[if lt IE 8]>\n <div id="oldie-warning" class="do-not-print">\n <p><strong>Notice:</strong> Your browser is <em>ancient</em> and <a href="http://www.ie6countdown.com/">Microsoft agrees</a>. <a href="http://browsehappy.com/">Upgrade to a different browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to experience a better web.</p>\n </div>\n <![endif]-->\n<!-- Sister Site Links -->\n<div class="top-bar do-not-print" id="top">\n<nav class="meta-navigation container" role="navigation">\n<div class="skip-link screen-reader-text">\n<a href="#content" title="Skip to content">Skip to content</a>\n</div>\n<a aria-hidden="true" class="jump-link" href="#python-network" id="close-python-network">\n<span aria-hidden="true" class="icon-arrow-down"><span>\u25bc</span></span> Close\n </a>\n<ul class="menu" role="tree">\n<li class="python-meta current_item selectedcurrent_branch selected">\n<a class="current_item selectedcurrent_branch selected" href="/" title="The Python Programming Language">Python</a>\n</li>\n<li class="psf-meta ">\n<a href="/psf-landing/" title="The Python Software Foundation">PSF</a>\n</li>\n<li class="docs-meta ">\n<a href="https://docs.python.org" title="Python Documentation">Docs</a>\n</li>\n<li class="pypi-meta ">\n<a href="https://pypi.python.org/" title="Python Package Index">PyPI</a>\n</li>\n<li class="jobs-meta ">\n<a href="/jobs/" title="Python Job Board">Jobs</a>\n</li>\n<li class="shop-meta ">\n<a href="/community/" title="Python Community">Community</a>\n</li>\n</ul>\n<a aria-hidden="true" class="jump-link" href="#top" id="python-network">\n<span aria-hidden="true" class="icon-arrow-up"><span>\u25b2</span></span> The Python Network\n </a>\n</nav>\n</div>\n<!-- Header elements -->\n<header class="main-header" role="banner">\n<div class="container">\n<h1 class="site-headline">\n<a href="/"><img alt="python\u2122" class="python-logo" src="/static/img/python-logo.png"/></a>\n</h1>\n<div class="options-bar do-not-print">\n<a class="jump-to-menu" href="#site-map" id="site-map-link"><span class="menu-icon">\u2261</span> Menu</a><form action="/search/" class="search-the-site" method="get">\n<fieldset title="Search Python.org">\n<span aria-hidden="true" class="icon-search"></span>\n<label class="screen-reader-text" for="id-search-field">Search This Site</label>\n<input class="search-field" id="id-search-field" name="q" placeholder="Search" role="textbox" tabindex="1" type="search" value=""/>\n<button class="search-button" id="submit" name="submit" tabindex="3" title="Submit this Search" type="submit">\n GO\n </button>\n<!--[if IE]><input type="text" style="display: none;" disabled="disabled" size="1" tabindex="4"><![endif]-->\n</fieldset>\n</form><span class="breaker"></span><div aria-hidden="true" class="adjust-font-size">\n<ul aria-label="Adjust Text Size on Page" class="navigation menu">\n<li aria-haspopup="true" class="tier-1 last">\n<a class="action-trigger" href="#"><strong><small>A</small> A</strong></a>\n<ul class="subnav menu">\n<li class="tier-2 element-1" role="treeitem"><a class="text-shrink" href="javascript:;" title="Make Text Smaller">Smaller</a></li>\n<li class="tier-2 element-2" role="treeitem"><a class="text-grow" href="javascript:;" title="Make Text Larger">Larger</a></li>\n<li class="tier-2 element-3" role="treeitem"><a class="text-reset" href="javascript:;" title="Reset any font size changes I have made">Reset</a></li>\n</ul>\n</li>\n</ul>\n</div><div class="winkwink-nudgenudge">\n<ul aria-label="Social Media Navigation" class="navigation menu">\n<li aria-haspopup="true" class="tier-1 last">\n<a class="action-trigger" href="#">Socialize</a>\n<ul class="subnav menu">\n<li class="tier-2 element-1" role="treeitem"><a href="http://plus.google.com/+Python"><span aria-hidden="true" class="icon-google-plus"></span>Google+</a></li>\n<li class="tier-2 element-2" role="treeitem"><a href="http://www.facebook.com/pythonlang?fref=ts"><span aria-hidden="true" class="icon-facebook"></span>Facebook</a></li>\n<li class="tier-2 element-3" role="treeitem"><a href="http://twitter.com/ThePSF"><span aria-hidden="true" class="icon-twitter"></span>Twitter</a></li>\n<li class="tier-2 element-4" role="treeitem"><a href="/community/irc/"><span aria-hidden="true" class="icon-freenode"></span>Chat on IRC</a></li>\n</ul>\n</li>\n</ul>\n</div><div class="account-signin">\n<ul aria-label="Social Media Navigation" class="navigation menu">\n<li aria-haspopup="true" class="tier-1 last">\n<a href="/accounts/login/" title="Sign Up or Sign In to Python.org">Sign In</a>\n<ul class="subnav menu">\n<li class="tier-2 element-1" role="treeitem"><a href="/accounts/signup/">Sign Up / Register</a></li>\n<li class="tier-2 element-2" role="treeitem"><a href="/accounts/login/">Sign In</a></li>\n</ul>\n</li>\n</ul>\n</div>\n</div><!-- end options-bar -->\n<nav class="python-navigation main-navigation do-not-print" id="mainnav" role="navigation">\n<ul aria-label="Main Navigation" class="navigation menu" role="menubar">\n<li aria-haspopup="true" class="tier-1 element-1 " id="about">\n<a class="" href="/about/" title="">About</a>\n<ul aria-hidden="true" class="subnav menu" role="menu">\n<li class="tier-2 element-1" role="treeitem"><a href="/about/apps/" title="">Applications</a></li>\n<li class="tier-2 element-2" role="treeitem"><a href="/about/quotes/" title="">Quotes</a></li>\n<li class="tier-2 element-3" role="treeitem"><a href="/about/gettingstarted/" title="">Getting Started</a></li>\n<li class="tier-2 element-4" role="treeitem"><a href="/about/help/" title="">Help</a></li>\n<li class="tier-2 element-5" role="treeitem"><a href="http://brochure.getpython.info/" title="">Python Brochure</a></li>\n</ul>\n</li>\n<li aria-haspopup="true" class="tier-1 element-2 " id="downloads">\n<a class="" href="/downloads/" title="">Downloads</a>\n<ul aria-hidden="true" class="subnav menu" role="menu">\n<li class="tier-2 element-1" role="treeitem"><a href="/downloads/" title="">All releases</a></li>\n<li class="tier-2 element-2" role="treeitem"><a href="/downloads/source/" title="">Source code</a></li>\n<li class="tier-2 element-3" role="treeitem"><a href="/downloads/windows/" title="">Windows</a></li>\n<li class="tier-2 element-4" role="treeitem"><a href="/downloads/mac-osx/" title="">Mac OS X</a></li>\n<li class="tier-2 element-5" role="treeitem"><a href="/download/other/" title="">Other Platforms</a></li>\n<li class="tier-2 element-6" role="treeitem"><a href="https://docs.python.org/3/license.html" title="">License</a></li>\n<li class="tier-2 element-7" role="treeitem"><a href="/download/alternatives" title="">Alternative Implementations</a></li>\n</ul>\n</li>\n<li aria-haspopup="true" class="tier-1 element-3 " id="documentation">\n<a class="" href="/doc/" title="">Documentation</a>\n<ul aria-hidden="true" class="subnav menu" role="menu">\n<li class="tier-2 element-1" role="treeitem"><a href="/doc/" title="">Docs</a></li>\n<li class="tier-2 element-2" role="treeitem"><a href="/doc/av" title="">Audio/Visual Talks</a></li>\n<li class="tier-2 element-3" role="treeitem"><a href="https://wiki.python.org/moin/BeginnersGuide" title="">Beginner's Guide</a></li>\n<li class="tier-2 element-4" role="treeitem"><a href="https://docs.python.org/devguide/" title="">Developer's Guide</a></li>\n<li class="tier-2 element-5" role="treeitem"><a href="https://docs.python.org/faq/" title="">FAQ</a></li>\n<li class="tier-2 element-6" role="treeitem"><a href="http://wiki.python.org/moin/Languages" title="">Non-English Docs</a></li>\n<li class="tier-2 element-7" role="treeitem"><a href="http://python.org/dev/peps/" title="">PEP Index</a></li>\n<li class="tier-2 element-8" role="treeitem"><a href="https://wiki.python.org/moin/PythonBooks" title="">Python Books</a></li>\n</ul>\n</li>\n<li aria-haspopup="true" class="tier-1 element-4 " id="community">\n<a class="" href="/community/" title="">Community</a>\n<ul aria-hidden="true" class="subnav menu" role="menu">\n<li class="tier-2 element-1" role="treeitem"><a href="/community/diversity/" title="">Diversity</a></li>\n<li class="tier-2 element-2" role="treeitem"><a href="/community/irc/" title="">IRC</a></li>\n<li class="tier-2 element-3" role="treeitem"><a href="/community/lists/" title="">Mailing Lists</a></li>\n<li class="tier-2 element-4" role="treeitem"><a href="/community/workshops/" title="">Python Conferences</a></li>\n<li class="tier-2 element-5" role="treeitem"><a href="/community/sigs/" title="">Special Interest Groups</a></li>\n<li class="tier-2 element-6" role="treeitem"><a href="https://wiki.python.org/moin/" title="">Python Wiki</a></li>\n<li class="tier-2 element-7" role="treeitem"><a href="/community/logos/" title="">Python Logo</a></li>\n<li class="tier-2 element-8" role="treeitem"><a href="/community/merchandise/" title="">Merchandise</a></li>\n<li class="tier-2 element-9" role="treeitem"><a href="/community/awards" title="">Community Awards</a></li>\n</ul>\n</li>\n<li aria-haspopup="true" class="tier-1 element-5 " id="success-stories">\n<a class="" href="/about/success/" title="success-stories">Success Stories</a>\n<ul aria-hidden="true" class="subnav menu" role="menu">\n<li class="tier-2 element-1" role="treeitem"><a href="/about/success/#arts" title="">Arts</a></li>\n<li class="tier-2 element-2" role="treeitem"><a href="/about/success/#business" title="">Business</a></li>\n<li class="tier-2 element-3" role="treeitem"><a href="/about/success/#education" title="">Education</a></li>\n<li class="tier-2 element-4" role="treeitem"><a href="/about/success/#engineering" title="">Engineering</a></li>\n<li class="tier-2 element-5" role="treeitem"><a href="/about/success/#government" title="">Government</a></li>\n<li class="tier-2 element-6" role="treeitem"><a href="/about/success/#scientific" title="">Scientific</a></li>\n<li class="tier-2 element-7" role="treeitem"><a href="/about/success/#software-development" title="">Software Development</a></li>\n</ul>\n</li>\n<li aria-haspopup="true" class="tier-1 element-6 " id="news">\n<a class="" href="/blogs/" title="News from around the Python world">News</a>\n<ul aria-hidden="true" class="subnav menu" role="menu">\n<li class="tier-2 element-1" role="treeitem"><a href="/blogs/" title="Python Insider Blog Posts">Python News</a></li>\n<li class="tier-2 element-2" role="treeitem"><a href="http://planetpython.org/" title="Planet Python">Community News</a></li>\n<li class="tier-2 element-3" role="treeitem"><a href="http://pyfound.blogspot.com/" title="PSF Blog">PSF News</a></li>\n<li class="tier-2 element-4" role="treeitem"><a href="http://pycon.blogspot.com/" title="PyCon Blog">PyCon News</a></li>\n</ul>\n</li>\n<li aria-haspopup="true" class="tier-1 element-7 " id="events">\n<a class="" href="/events/" title="">Events</a>\n<ul aria-hidden="true" class="subnav menu" role="menu">\n<li class="tier-2 element-1" role="treeitem"><a href="/events/python-events" title="">Python Events</a></li>\n<li class="tier-2 element-2" role="treeitem"><a href="/events/python-user-group/" title="">User Group Events</a></li>\n<li class="tier-2 element-3" role="treeitem"><a href="/events/python-events/past/" title="">Python Events Archive</a></li>\n<li class="tier-2 element-4" role="treeitem"><a href="/events/python-user-group/past/" title="">User Group Events Archive</a></li>\n<li class="tier-2 element-5" role="treeitem"><a href="https://wiki.python.org/moin/PythonEventsCalendar#Submitting_an_Event" title="">Submit an Event</a></li>\n</ul>\n</li>\n</ul>\n</nav>\n<div class="header-banner "> <!-- for optional "do-not-print" class -->\n<div class="flex-slideshow slideshow" id="dive-into-python">\n<ul class="launch-shell menu" id="launch-shell">\n<li>\n<a class="button prompt" data-shell-container="#dive-into-python" href="/shell/" id="start-shell">>_\n <span class="message">Launch Interactive Shell</span>\n</a>\n</li>\n</ul>\n<ul class="slides menu">\n<li>\n<div class="slide-code"><pre><code><span class="comment"># Python 3: Fibonacci series up to n</span>\r\n>>> def fib(n):\r\n>>> a, b = 0, 1\r\n>>> while a < n:\r\n>>> print(a, end=' ')\r\n>>> a, b = b, a+b\r\n>>> print()\r\n>>> fib(1000)\r\n<span class="output">0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987</span></code></pre></div>\n<div class="slide-copy"><h1>Functions Defined</h1>\n<p>The core of extensible programming is defining functions. Python allows mandatory and optional arguments, keyword arguments, and even arbitrary argument lists. <a href="//docs.python.org/3/tutorial/controlflow.html#defining-functions">More about defining functions in Python\xa03</a></p></div>\n</li>\n<li>\n<div class="slide-code"><pre><code><span class="comment"># Python 3: List comprehensions</span>\r\n>>> fruits = ['Banana', 'Apple', 'Lime']\r\n>>> loud_fruits = [fruit.upper() for fruit in fruits]\r\n>>> print(loud_fruits)\r\n<span class="output">['BANANA', 'APPLE', 'LIME']</span>\r\n\r\n<span class="comment"># List and the enumerate function</span>\r\n>>> list(enumerate(fruits))\r\n<span class="output">[(0, 'Banana'), (1, 'Apple'), (2, 'Lime')]</span></code></pre></div>\n<div class="slide-copy"><h1>Compound Data Types</h1>\n<p>Lists (known as arrays in other languages) are one of the compound data types that Python understands. Lists can be indexed, sliced and manipulated with other built-in functions. <a href="//docs.python.org/3/tutorial/introduction.html#lists">More about lists in Python\xa03</a></p></div>\n</li>\n<li>\n<div class="slide-code"><pre><code><span class="comment"># Python 3: Simple arithmetic</span>\r\n>>> 1 / 2\r\n<span class="output">0.5</span>\r\n>>> 2 ** 3\r\n<span class="output">8</span>\r\n>>> 17 / 3 <span class="comment"># classic division returns a float</span>\r\n<span class="output">5.666666666666667</span>\r\n>>> 17 // 3 <span class="comment"># floor division</span>\r\n<span class="output">5</span></code></pre></div>\n<div class="slide-copy"><h1>Intuitive Interpretation</h1>\n<p>Calculations are simple with Python, and expression syntax is straightforward: the operators <code>+</code>, <code>-</code>, <code>*</code> and <code>/</code> work as expected; parentheses <code>()</code> can be used for grouping. <a href="http://docs.python.org/3/tutorial/introduction.html#using-python-as-a-calculator">More about simple math functions in Python\xa03</a>.</p></div>\n</li>\n<li>\n<div class="slide-code"><pre><code><span class="comment"># Python 3: Simple output (with Unicode)</span>\r\n>>> print("Hello, I'm Python!")\r\n<span class="output">Hello, I'm Python!</span>\r\n\r\n<span class="comment"># Input, assignment</span>\r\n>>> name = input('What is your name?\\n')\r\n>>> print('Hi, %s.' % name)\r\n<span class="output">What is your name?\r\nPython\r\nHi, Python.</span></code></pre></div>\n<div class="slide-copy"><h1>Quick & Easy to Learn</h1>\n<p>Experienced programmers in any other language can pick up Python very quickly, and beginners find the clean syntax and indentation structure easy to learn. <a href="//docs.python.org/3/tutorial/">Whet your appetite</a> with our Python\xa03 overview.</p>\n</div>\n</li>\n<li>\n<div class="slide-code"><pre><code><span class="comment"># For loop on a list</span>\r\n>>> numbers = [2, 4, 6, 8]\r\n>>> product = 1\r\n>>> for number in numbers:\r\n... product = product * number\r\n... \r\n>>> print('The product is:', product)\r\n<span class="output">The product is: 384</span></code></pre></div>\n<div class="slide-copy"><h1>All the Flow You\u2019d Expect</h1>\n<p>Python knows the usual control flow statements that other languages speak \u2014 <code>if</code>, <code>for</code>, <code>while</code> and <code>range</code> \u2014 with some of its own twists, of course. <a href="//docs.python.org/3/tutorial/controlflow.html">More control flow tools in Python\xa03</a></p></div>\n</li>\n</ul>\n</div>\n</div>\n<div class="introduction">\n<p>Python is a programming language that lets you work quickly <span class="breaker"></span>and integrate systems more effectively. <a class="readmore" href="/doc/">Learn More</a></p>\n</div>\n</div><!-- end .container -->\n</header>\n<div class="content-wrapper" id="content">\n<!-- Main Content Column -->\n<div class="container">\n<section class="main-content " role="main">\n<div class="row">\n<div class="small-widget get-started-widget">\n<h2 class="widget-title"><span aria-hidden="true" class="icon-get-started"></span>Get Started</h2>\n<p>Whether you're new to programming or an experienced developer, it's easy to learn and use Python.</p>\n<p><a href="/about/gettingstarted/">Start with our Beginner\u2019s Guide</a></p>\n</div>\n<div class="small-widget download-widget">\n<h2 class="widget-title"><span aria-hidden="true" class="icon-download"></span>Download</h2>\n<p>Python source code and installers are available for download for all versions! Not sure which version to use? <a href="https://wiki.python.org/moin/Python2orPython3">Check here</a>.</p>\n<p>Latest: <a href="/downloads/release/python-352/">Python 3.5.2</a> - <a href="/downloads/release/python-2712/">Python 2.7.12</a></p>\n</div>\n<div class="small-widget documentation-widget">\n<h2 class="widget-title"><span aria-hidden="true" class="icon-documentation"></span>Docs</h2>\n<p>Documentation for Python's standard library, along with tutorials and guides, are available online.</p>\n<p><a href="https://docs.python.org">docs.python.org</a></p>\n</div>\n<div class="small-widget jobs-widget last">\n<h2 class="widget-title"><span aria-hidden="true" class="icon-jobs"></span>Jobs</h2>\n<p>Looking for work or have a Python related position that you're trying to hire for? Our <strong>relaunched community-run job board</strong> is the place to go.</p>\n<p><a href="//jobs.python.org">jobs.python.org</a></p>\n</div>\n</div>\n<div class="list-widgets row">\n<div class="medium-widget blog-widget">\n<div class="shrubbery">\n<h2 class="widget-title"><span aria-hidden="true" class="icon-news"></span>Latest News</h2>\n<p class="give-me-more"><a href="http://blog.python.org" title="More News">More</a></p>\n<ul class="menu">\n<li>\n<time datetime="2016-06-28T04:26:00.000001+00:00"><span class="say-no-more">2016-</span>06-28</time>\n<a href="http://feedproxy.google.com/~r/PythonInsider/~3/1zUlkKxW27U/python-2712-released.html">The Python 2.7.x series has a new bugfix release, Python ...</a></li>\n<li>\n<time datetime="2016-06-27T08:33:00+00:00"><span class="say-no-more">2016-</span>06-27</time>\n<a href="http://feedproxy.google.com/~r/PythonInsider/~3/gCTfatUv_t4/python-352-and-python-345-are-now.html">Python 3.5.2 and Python 3.4.5 are now available for download. ...</a></li>\n<li>\n<time datetime="2016-06-14T06:06:00.000001+00:00"><span class="say-no-more">2016-</span>06-14</time>\n<a href="http://feedproxy.google.com/~r/PythonInsider/~3/yaupkpp9kLc/python-2712-release-candidate-available.html">The first release candidate of Python 2.7.12, the next bugfix ...</a></li>\n<li>\n<time datetime="2016-06-14T04:06:00.000001+00:00"><span class="say-no-more">2016-</span>06-14</time>\n<a href="http://feedproxy.google.com/~r/PythonInsider/~3/nE_a_L4mHfk/python-360-alpha-2-preview-release-is.html">Python 3.6.0a2\xa0has been\xa0released.\xa0\xa03.6.0a2 is the second of four planned alpha ...</a></li>\n<li>\n<time datetime="2016-06-13T03:18:00+00:00"><span class="say-no-more">2016-</span>06-13</time>\n<a href="http://feedproxy.google.com/~r/PythonInsider/~3/sDMmUdw_7RU/python-352rc1-and-python-345rc1-are-now.html">Python 3.5.2rc1 and Python 3.4.5rc1 are now available for download. ...</a></li>\n</ul>\n</div><!-- end .shrubbery -->\n</div>\n<div class="medium-widget event-widget last">\n<div class="shrubbery">\n<h2 class="widget-title"><span aria-hidden="true" class="icon-calendar"></span>Upcoming Events</h2>\n<p class="give-me-more"><a href="/events/calendars/" title="More Events">More</a></p>\n<ul class="menu">\n<li>\n<time datetime="2016-07-06T16:00:00+00:00"><span class="say-no-more">2016-</span>07-06</time>\n<a href="/events/python-user-group/403/">Python Meeting D\xfcsseldorf</a></li>\n<li>\n<time datetime="2016-07-09T00:00:00+00:00"><span class="say-no-more">2016-</span>07-09</time>\n<a href="/events/python-user-group/436/">Django Girls Guayaquil</a></li>\n<li>\n<time datetime="2016-07-16T00:00:00+00:00"><span class="say-no-more">2016-</span>07-16</time>\n<a href="/events/python-events/426/">PyGotham 2016</a></li>\n<li>\n<time datetime="2016-07-17T00:00:00+00:00"><span class="say-no-more">2016-</span>07-17</time>\n<a href="/events/python-events/370/">EuroPython 2016</a></li>\n<li>\n<time datetime="2016-07-29T00:00:00+00:00"><span class="say-no-more">2016-</span>07-29</time>\n<a href="/events/python-events/401/">PyOhio 2016</a></li>\n</ul>\n</div>\n</div>\n</div>\n<div class="row">\n<div class="medium-widget success-stories-widget">\n<div class="shrubbery">\n<h2 class="widget-title"><span aria-hidden="true" class="icon-success-stories"></span>Success Stories</h2>\n<p class="give-me-more"><a href="/success-stories/" title="More Success Stories">More</a></p>\n<div class="success-story-item" data-weight="0" id="success-story-2" style="display: none;">\n<blockquote>\n<a href="/success-stories/industrial-light-magic-runs-python/">ILM runs a batch processing environment capable of modeling, rendering and compositing tens of thousands of motion picture frames per day. Thousands of machines running Linux, IRIX, Compaq Tru64, OS X, Solaris, and Windows join together to provide a production pipeline used by ~800 users daily. Speed of development is key, and Python was a faster way to code (and re-code) the programs that control this production pipeline.</a>\n</blockquote>\n<table border="0" cellpadding="0" cellspacing="0" class="quote-from" width="100%">\n<tbody>\n<tr>\n<td><p><a href="/success-stories/industrial-light-magic-runs-python/">Industrial Light & Magic Runs on Python</a> <em>by Tim Fortenberry</em></p></td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><!-- end .shrubbery -->\n</div>\n<div class="medium-widget applications-widget last">\n<div class="shrubbery">\n<h2 class="widget-title"><span aria-hidden="true" class="icon-python"></span>Use Python for\u2026</h2>\n<p class="give-me-more"><a href="/about/apps" title="More Applications">More</a></p>\n<ul class="menu">\n<li><b>Web Programming</b>:\r\n <span class="tag-wrapper"><a class="tag" href="http://www.djangoproject.com/">Django</a>, <a class="tag" href="http://www.pylonsproject.org/">Pyramid</a>, <a class="tag" href="http://bottlepy.org">Bottle</a>, <a class="tag" href="http://tornadoweb.org">Tornado</a>, <a class="tag" href="http://flask.pocoo.org/">Flask</a>, <a class="tag" href="http://www.web2py.com/">web2py</a></span></li>\n<li><b>GUI Development</b>:\r\n <span class="tag-wrapper"><a class="tag" href="http://www.wxpython.org/">wxPython</a>, <a class="tag" href="http://wiki.python.org/moin/TkInter">tkInter</a>, <a class="tag" href="http://www.pygtk.org">PyGtk</a>, <a class="tag" href="https://wiki.gnome.org/Projects/PyGObject">PyGObject</a>, <a class="tag" href="http://www.riverbankcomputing.co.uk/software/pyqt/intro">PyQt</a></span></li>\n<li><b>Scientific and Numeric</b>:\r\n <span class="tag-wrapper">\n<a class="tag" href="http://www.scipy.org">SciPy</a>, <a class="tag" href="http://pandas.pydata.org/">Pandas</a>, <a class="tag" href="http://ipython.org">IPython</a></span></li>\n<li><b>Software Development</b>:\r\n <span class="tag-wrapper"><a class="tag" href="http://buildbot.net/">Buildbot</a>, <a class="tag" href="http://trac.edgewall.org/">Trac</a>, <a class="tag" href="http://roundup.sourceforge.net/">Roundup</a></span></li>\n<li><b>System Administration</b>:\r\n <span class="tag-wrapper"><a class="tag" href="http://www.ansible.com">Ansible</a>, <a class="tag" href="http://www.saltstack.com">Salt</a>, <a class="tag" href="https://www.openstack.org">OpenStack</a></span></li>\n</ul>\n</div><!-- end .shrubbery -->\n</div>\n</div>\n<div class="pep-widget">\n<h2 class="widget-title">\n<span class="prompt">>>></span> <a href="/dev/peps/">Python Enhancement Proposals<span class="say-no-more"> (PEPs)</span></a>: The future of Python<span class="say-no-more"> is discussed here.</span>\n<a aria-hidden="true" class="rss-link" href="/dev/peps/peps.rss"><span class="icon-feed"></span> RSS</a>\n</h2>\n</div>\n<div class="psf-widget">\n<div class="python-logo"></div>\n<h2 class="widget-title">\n<span class="prompt">>>></span> <a href="/psf/">Python Software Foundation</a>\n</h2>\n<p>The mission of the Python Software Foundation is to promote, protect, and advance the Python programming language, and to support and facilitate the growth of a diverse and international community of Python programmers. <a class="readmore" href="/psf/">Learn more</a> </p>\n<p class="click-these">\n<a class="button" href="/users/membership/">Become a Member</a>\n<a class="button" href="/psf/donations/">Donate to the PSF</a>\n</p>\n</div>\n</section>\n</div><!-- end .container -->\n</div><!-- end #content .content-wrapper -->\n<!-- Footer and social media list -->\n<footer class="main-footer" id="site-map" role="contentinfo">\n<div class="main-footer-links">\n<div class="container">\n<a class="jump-link" href="#python-network" id="back-to-top-1"><span aria-hidden="true" class="icon-arrow-up"><span>\u25b2</span></span> Back to Top</a>\n<ul class="sitemap navigation menu do-not-print" id="container" role="tree">\n<li class="tier-1 element-1">\n<a href="/about/">About</a>\n<ul class="subnav menu">\n<li class="tier-2 element-1" role="treeitem"><a href="/about/apps/" title="">Applications</a></li>\n<li class="tier-2 element-2" role="treeitem"><a href="/about/quotes/" title="">Quotes</a></li>\n<li class="tier-2 element-3" role="treeitem"><a href="/about/gettingstarted/" title="">Getting Started</a></li>\n<li class="tier-2 element-4" role="treeitem"><a href="/about/help/" title="">Help</a></li>\n<li class="tier-2 element-5" role="treeitem"><a href="http://brochure.getpython.info/" title="">Python Brochure</a></li>\n</ul>\n</li>\n<li class="tier-1 element-2">\n<a href="/downloads/">Downloads</a>\n<ul class="subnav menu">\n<li class="tier-2 element-1" role="treeitem"><a href="/downloads/" title="">All releases</a></li>\n<li class="tier-2 element-2" role="treeitem"><a href="/downloads/source/" title="">Source code</a></li>\n<li class="tier-2 element-3" role="treeitem"><a href="/downloads/windows/" title="">Windows</a></li>\n<li class="tier-2 element-4" role="treeitem"><a href="/downloads/mac-osx/" title="">Mac OS X</a></li>\n<li class="tier-2 element-5" role="treeitem"><a href="/download/other/" title="">Other Platforms</a></li>\n<li class="tier-2 element-6" role="treeitem"><a href="https://docs.python.org/3/license.html" title="">License</a></li>\n<li class="tier-2 element-7" role="treeitem"><a href="/download/alternatives" title="">Alternative Implementations</a></li>\n</ul>\n</li>\n<li class="tier-1 element-3">\n<a href="/doc/">Documentation</a>\n<ul class="subnav menu">\n<li class="tier-2 element-1" role="treeitem"><a href="/doc/" title="">Docs</a></li>\n<li class="tier-2 element-2" role="treeitem"><a href="/doc/av" title="">Audio/Visual Talks</a></li>\n<li class="tier-2 element-3" role="treeitem"><a href="https://wiki.python.org/moin/BeginnersGuide" title="">Beginner's Guide</a></li>\n<li class="tier-2 element-4" role="treeitem"><a href="https://docs.python.org/devguide/" title="">Developer's Guide</a></li>\n<li class="tier-2 element-5" role="treeitem"><a href="https://docs.python.org/faq/" title="">FAQ</a></li>\n<li class="tier-2 element-6" role="treeitem"><a href="http://wiki.python.org/moin/Languages" title="">Non-English Docs</a></li>\n<li class="tier-2 element-7" role="treeitem"><a href="http://python.org/dev/peps/" title="">PEP Index</a></li>\n<li class="tier-2 element-8" role="treeitem"><a href="https://wiki.python.org/moin/PythonBooks" title="">Python Books</a></li>\n</ul>\n</li>\n<li class="tier-1 element-4">\n<a href="/community/">Community</a>\n<ul class="subnav menu">\n<li class="tier-2 element-1" role="treeitem"><a href="/community/diversity/" title="">Diversity</a></li>\n<li class="tier-2 element-2" role="treeitem"><a href="/community/irc/" title="">IRC</a></li>\n<li class="tier-2 element-3" role="treeitem"><a href="/community/lists/" title="">Mailing Lists</a></li>\n<li class="tier-2 element-4" role="treeitem"><a href="/community/workshops/" title="">Python Conferences</a></li>\n<li class="tier-2 element-5" role="treeitem"><a href="/community/sigs/" title="">Special Interest Groups</a></li>\n<li class="tier-2 element-6" role="treeitem"><a href="https://wiki.python.org/moin/" title="">Python Wiki</a></li>\n<li class="tier-2 element-7" role="treeitem"><a href="/community/logos/" title="">Python Logo</a></li>\n<li class="tier-2 element-8" role="treeitem"><a href="/community/merchandise/" title="">Merchandise</a></li>\n<li class="tier-2 element-9" role="treeitem"><a href="/community/awards" title="">Community Awards</a></li>\n</ul>\n</li>\n<li class="tier-1 element-5">\n<a href="/about/success/" title="success-stories">Success Stories</a>\n<ul class="subnav menu">\n<li class="tier-2 element-1" role="treeitem"><a href="/about/success/#arts" title="">Arts</a></li>\n<li class="tier-2 element-2" role="treeitem"><a href="/about/success/#business" title="">Business</a></li>\n<li class="tier-2 element-3" role="treeitem"><a href="/about/success/#education" title="">Education</a></li>\n<li class="tier-2 element-4" role="treeitem"><a href="/about/success/#engineering" title="">Engineering</a></li>\n<li class="tier-2 element-5" role="treeitem"><a href="/about/success/#government" title="">Government</a></li>\n<li class="tier-2 element-6" role="treeitem"><a href="/about/success/#scientific" title="">Scientific</a></li>\n<li class="tier-2 element-7" role="treeitem"><a href="/about/success/#software-development" title="">Software Development</a></li>\n</ul>\n</li>\n<li class="tier-1 element-6">\n<a href="/blogs/" title="News from around the Python world">News</a>\n<ul class="subnav menu">\n<li class="tier-2 element-1" role="treeitem"><a href="/blogs/" title="Python Insider Blog Posts">Python News</a></li>\n<li class="tier-2 element-2" role="treeitem"><a href="http://planetpython.org/" title="Planet Python">Community News</a></li>\n<li class="tier-2 element-3" role="treeitem"><a href="http://pyfound.blogspot.com/" title="PSF Blog">PSF News</a></li>\n<li class="tier-2 element-4" role="treeitem"><a href="http://pycon.blogspot.com/" title="PyCon Blog">PyCon News</a></li>\n</ul>\n</li>\n<li class="tier-1 element-7">\n<a href="/events/">Events</a>\n<ul class="subnav menu">\n<li class="tier-2 element-1" role="treeitem"><a href="/events/python-events" title="">Python Events</a></li>\n<li class="tier-2 element-2" role="treeitem"><a href="/events/python-user-group/" title="">User Group Events</a></li>\n<li class="tier-2 element-3" role="treeitem"><a href="/events/python-events/past/" title="">Python Events Archive</a></li>\n<li class="tier-2 element-4" role="treeitem"><a href="/events/python-user-group/past/" title="">User Group Events Archive</a></li>\n<li class="tier-2 element-5" role="treeitem"><a href="https://wiki.python.org/moin/PythonEventsCalendar#Submitting_an_Event" title="">Submit an Event</a></li>\n</ul>\n</li>\n<li class="tier-1 element-8">\n<a href="/dev/">Contributing</a>\n<ul class="subnav menu">\n<li class="tier-2 element-1" role="treeitem"><a href="http://docs.python.org/devguide/" title="">Developer's Guide</a></li>\n<li class="tier-2 element-2" role="treeitem"><a href="http://bugs.python.org/" title="">Issue Tracker</a></li>\n<li class="tier-2 element-3" role="treeitem"><a href="https://mail.python.org/mailman/listinfo/python-dev" title="">python-dev list</a></li>\n<li class="tier-2 element-4" role="treeitem"><a href="http://pythonmentors.com/" title="">Core Mentorship</a></li>\n</ul>\n</li>\n</ul>\n<a class="jump-link" href="#python-network" id="back-to-top-2"><span aria-hidden="true" class="icon-arrow-up"><span>\u25b2</span></span> Back to Top</a>\n</div><!-- end .container -->\n</div> <!-- end .main-footer-links -->\n<div class="site-base">\n<div class="container">\n<ul class="footer-links navigation menu do-not-print" role="tree">\n<li class="tier-1 element-1"><a href="/about/help/">Help & <span class="say-no-more">General</span> Contact</a></li>\n<li class="tier-1 element-2"><a href="/community/diversity/">Diversity <span class="say-no-more">Initiatives</span></a></li>\n<li class="tier-1 element-3"><a href="https://github.com/python/pythondotorg/issues">Submit Website Bug</a></li>\n<li class="tier-1 element-4">\n<a href="https://status.python.org/">Status <span class="python-status-indicator-default" id="python-status-indicator"></span></a>\n</li>\n</ul>\n<div class="copyright">\n<p><small>\n<span class="pre">Copyright \xa92001-2016.</span>\n \xa0<span class="pre"><a href="/psf-landing/">Python Software Foundation</a></span>\n \xa0<span class="pre"><a href="/about/legal/">Legal Statements</a></span>\n \xa0<span class="pre"><a href="/privacy/">Privacy Policy</a></span>\n</small></p>\n</div>\n</div><!-- end .container -->\n</div><!-- end .site-base -->\n</footer>\n</div><!-- end #touchnav-wrapper -->\n<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>\n<script>window.jQuery || document.write('<script src="/static/js/libs/jquery-1.8.2.min.js"><\\/script>')</script>\n<script src="/static/js/libs/masonry.pkgd.min.js"></script>\n<script charset="utf-8" src="/static/js/main-min.js" type="text/javascript"></script>\n<!--[if lte IE 7]>\n <script type="text/javascript" src="/static/js/plugins/IE8-min.js" charset="utf-8"></script>\n \n \n <![endif]-->\n<!--[if lte IE 8]>\n <script type="text/javascript" src="/static/js/plugins/getComputedStyle-min.js" charset="utf-8"></script>\n \n \n <![endif]-->\n</body>\n</html>\n
In [20]:
tree?
In [24]:
paras = tree.findAll('p')
paras
Out[24]:
[<p>We are an international mentorship group with a focus on helping more women become active participants and leaders in the Python open-source community. Our mission is to promote, educate and advance a diverse Python community through outreach, education, conferences, events and social gatherings.</p>,
<p>PyLadies also aims to provide a friendly support network for women and a bridge to the larger Python world. Anyone with an interest in Python is encouraged to participate!</p>,
<p><a href="http://www.djangoproject.com/">Django</a> is one of the most popular web frameworks. It\u2019s a great option if you want to use Python to build web apps. Start with <a href="https://docs.djangoproject.com/en/1.4/intro/tutorial01/">the official Django poll tutorial</a> or the <a href="http://tutorial.djangogirls.org/">Django Girls blog tutorial</a>. <a href="http://twoscoopspress.com/products/two-scoops-of-django-1-8">Two Scoops of Django: Best Practices For Django 1.8</a> was co-written by a PyLady - don\u2019t hesitate to ask for a free copy if you can\u2019t afford it. <a class="more-link" href="/blog/Web-Development/django-resources/">Read more \u2192</a></p>,
<p>Want to pack your PyCon schedule with PyLadies events? Here are all the details! <a class="more-link" href="/blog/A-PyLadies-packed-PyCon-2015/pyladies-at-pycon/">Read more \u2192</a></p>]
In [ ]:
Content source: xpmanoj/content
Similar notebooks: