day 2

2019-07-24 23:56:57.322841

What's happening here you ask?

Well it's the funniest thing. I found this here file with just these three boxes underneath pointing to a client's website but basically no work after that. I was messing around with regex but I can't remember why. So this is what I messed around with today.

I'm deciding that I'm going to leave some of these code returns long just because it's still quite easy to scroll quickly through it.

The site I'm messing around with is Green Tea Press. If you haven't heard about it before you should go check it out. There's a bunch of college level programming texts on their for freeskis.

In [2]:
import re
def get_text(file):
    """Read text from a file, normalizing whitespace and stripping HTML markup"""
    text = file
    text = re.sub('\s+',' ',text)
    text = re.sub(r'<.*?>', ' ', text)
    return text

# this is the function I found. I don't know how and why I decided to make it.
In [3]:
import requests # requests is fun. 
In [4]:
response = requests.get("https://greenteapress.com/wp/") # get the thing from the internets
In [5]:
print(response.text) # print the thing, bunch of html code. woot.
<!DOCTYPE html>
<html lang="en-US" class="no-js">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width">
	<link rel="profile" href="http://gmpg.org/xfn/11">
	<link rel="pingback" href="https://greenteapress.com/wp/xmlrpc.php">
	<!--[if lt IE 9]>
	<script src="https://greenteapress.com/wp/wp-content/themes/twentyfifteen/js/html5.js"></script>
	<![endif]-->
	<script>(function(html){html.className = html.className.replace(/\bno-js\b/,'js')})(document.documentElement);</script>
<title>Green Tea Press &#8211; Free books by Allen B. Downey</title>
<link rel='dns-prefetch' href='//fonts.googleapis.com' />
<link rel='dns-prefetch' href='//s.w.org' />
<link href='https://fonts.gstatic.com' crossorigin rel='preconnect' />
<link rel="alternate" type="application/rss+xml" title="Green Tea Press &raquo; Feed" href="https://greenteapress.com/wp/feed/" />
<link rel="alternate" type="application/rss+xml" title="Green Tea Press &raquo; Comments Feed" href="https://greenteapress.com/wp/comments/feed/" />
		<script type="text/javascript">
			window._wpemojiSettings = {"baseUrl":"https:\/\/s.w.org\/images\/core\/emoji\/11\/72x72\/","ext":".png","svgUrl":"https:\/\/s.w.org\/images\/core\/emoji\/11\/svg\/","svgExt":".svg","source":{"concatemoji":"https:\/\/greenteapress.com\/wp\/wp-includes\/js\/wp-emoji-release.min.js?ver=5.0.4"}};
			!function(a,b,c){function d(a,b){var c=String.fromCharCode;l.clearRect(0,0,k.width,k.height),l.fillText(c.apply(this,a),0,0);var d=k.toDataURL();l.clearRect(0,0,k.width,k.height),l.fillText(c.apply(this,b),0,0);var e=k.toDataURL();return d===e}function e(a){var b;if(!l||!l.fillText)return!1;switch(l.textBaseline="top",l.font="600 32px Arial",a){case"flag":return!(b=d([55356,56826,55356,56819],[55356,56826,8203,55356,56819]))&&(b=d([55356,57332,56128,56423,56128,56418,56128,56421,56128,56430,56128,56423,56128,56447],[55356,57332,8203,56128,56423,8203,56128,56418,8203,56128,56421,8203,56128,56430,8203,56128,56423,8203,56128,56447]),!b);case"emoji":return b=d([55358,56760,9792,65039],[55358,56760,8203,9792,65039]),!b}return!1}function f(a){var c=b.createElement("script");c.src=a,c.defer=c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var g,h,i,j,k=b.createElement("canvas"),l=k.getContext&&k.getContext("2d");for(j=Array("flag","emoji"),c.supports={everything:!0,everythingExceptFlag:!0},i=0;i<j.length;i++)c.supports[j[i]]=e(j[i]),c.supports.everything=c.supports.everything&&c.supports[j[i]],"flag"!==j[i]&&(c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&c.supports[j[i]]);c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&!c.supports.flag,c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.everything||(h=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",h,!1),a.addEventListener("load",h,!1)):(a.attachEvent("onload",h),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),g=c.source||{},g.concatemoji?f(g.concatemoji):g.wpemoji&&g.twemoji&&(f(g.twemoji),f(g.wpemoji)))}(window,document,window._wpemojiSettings);
		</script>
		<style type="text/css">
img.wp-smiley,
img.emoji {
	display: inline !important;
	border: none !important;
	box-shadow: none !important;
	height: 1em !important;
	width: 1em !important;
	margin: 0 .07em !important;
	vertical-align: -0.1em !important;
	background: none !important;
	padding: 0 !important;
}
</style>
<link rel='stylesheet' id='wp-block-library-css'  href='https://greenteapress.com/wp/wp-includes/css/dist/block-library/style.min.css?ver=5.0.4' type='text/css' media='all' />
<link rel='stylesheet' id='wp-block-library-theme-css'  href='https://greenteapress.com/wp/wp-includes/css/dist/block-library/theme.min.css?ver=5.0.4' type='text/css' media='all' />
<link rel='stylesheet' id='twentyfifteen-fonts-css'  href='https://fonts.googleapis.com/css?family=Noto+Sans%3A400italic%2C700italic%2C400%2C700%7CNoto+Serif%3A400italic%2C700italic%2C400%2C700%7CInconsolata%3A400%2C700&#038;subset=latin%2Clatin-ext' type='text/css' media='all' />
<link rel='stylesheet' id='genericons-css'  href='https://greenteapress.com/wp/wp-content/plugins/jetpack/_inc/genericons/genericons/genericons.css?ver=3.1' type='text/css' media='all' />
<link rel='stylesheet' id='twentyfifteen-style-css'  href='https://greenteapress.com/wp/wp-content/themes/twentyfifteen/style.css?ver=5.0.4' type='text/css' media='all' />
<style id='twentyfifteen-style-inline-css' type='text/css'>

		/* Custom Header Background Color */
		body:before,
		.site-header {
			background-color: #aeccc5;
		}

		@media screen and (min-width: 59.6875em) {
			.site-header,
			.secondary {
				background-color: transparent;
			}

			.widget button,
			.widget input[type="button"],
			.widget input[type="reset"],
			.widget input[type="submit"],
			.widget_calendar tbody a,
			.widget_calendar tbody a:hover,
			.widget_calendar tbody a:focus {
				color: #aeccc5;
			}
		}
	

		/* Custom Sidebar Text Color */
		.site-title a,
		.site-description,
		.secondary-toggle:before {
			color: #002500;
		}

		.site-title a:hover,
		.site-title a:focus {
			color: #002500; /* Fallback for IE7 and IE8 */
			color: rgba( 0, 37, 0, 0.7);
		}

		.secondary-toggle {
			border-color: #002500; /* Fallback for IE7 and IE8 */
			border-color: rgba( 0, 37, 0, 0.1);
		}

		.secondary-toggle:hover,
		.secondary-toggle:focus {
			border-color: #002500; /* Fallback for IE7 and IE8 */
			border-color: rgba( 0, 37, 0, 0.3);
		}

		.site-title a {
			outline-color: #002500; /* Fallback for IE7 and IE8 */
			outline-color: rgba( 0, 37, 0, 0.3);
		}

		@media screen and (min-width: 59.6875em) {
			.secondary a,
			.dropdown-toggle:after,
			.widget-title,
			.widget blockquote cite,
			.widget blockquote small {
				color: #002500;
			}

			.widget button,
			.widget input[type="button"],
			.widget input[type="reset"],
			.widget input[type="submit"],
			.widget_calendar tbody a {
				background-color: #002500;
			}

			.textwidget a {
				border-color: #002500;
			}

			.secondary a:hover,
			.secondary a:focus,
			.main-navigation .menu-item-description,
			.widget,
			.widget blockquote,
			.widget .wp-caption-text,
			.widget .gallery-caption {
				color: rgba( 0, 37, 0, 0.7);
			}

			.widget button:hover,
			.widget button:focus,
			.widget input[type="button"]:hover,
			.widget input[type="button"]:focus,
			.widget input[type="reset"]:hover,
			.widget input[type="reset"]:focus,
			.widget input[type="submit"]:hover,
			.widget input[type="submit"]:focus,
			.widget_calendar tbody a:hover,
			.widget_calendar tbody a:focus {
				background-color: rgba( 0, 37, 0, 0.7);
			}

			.widget blockquote {
				border-color: rgba( 0, 37, 0, 0.7);
			}

			.main-navigation ul,
			.main-navigation li,
			.secondary-toggle,
			.widget input,
			.widget textarea,
			.widget table,
			.widget th,
			.widget td,
			.widget pre,
			.widget li,
			.widget_categories .children,
			.widget_nav_menu .sub-menu,
			.widget_pages .children,
			.widget abbr[title] {
				border-color: rgba( 0, 37, 0, 0.1);
			}

			.dropdown-toggle:hover,
			.dropdown-toggle:focus,
			.widget hr {
				background-color: rgba( 0, 37, 0, 0.1);
			}

			.widget input:focus,
			.widget textarea:focus {
				border-color: rgba( 0, 37, 0, 0.3);
			}

			.sidebar a:focus,
			.dropdown-toggle:focus {
				outline-color: rgba( 0, 37, 0, 0.3);
			}
		}
	
</style>
<link rel='stylesheet' id='twentyfifteen-block-style-css'  href='https://greenteapress.com/wp/wp-content/themes/twentyfifteen/css/blocks.css?ver=20181230' type='text/css' media='all' />
<!--[if lt IE 9]>
<link rel='stylesheet' id='twentyfifteen-ie-css'  href='https://greenteapress.com/wp/wp-content/themes/twentyfifteen/css/ie.css?ver=20141010' type='text/css' media='all' />
<![endif]-->
<!--[if lt IE 8]>
<link rel='stylesheet' id='twentyfifteen-ie7-css'  href='https://greenteapress.com/wp/wp-content/themes/twentyfifteen/css/ie7.css?ver=20141010' type='text/css' media='all' />
<![endif]-->
<script type='text/javascript' src='https://greenteapress.com/wp/wp-includes/js/jquery/jquery.js?ver=1.12.4'></script>
<script type='text/javascript' src='https://greenteapress.com/wp/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.4.1'></script>
<link rel='https://api.w.org/' href='https://greenteapress.com/wp/wp-json/' />
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="https://greenteapress.com/wp/xmlrpc.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="https://greenteapress.com/wp/wp-includes/wlwmanifest.xml" /> 
<meta name="generator" content="WordPress 5.0.4" />
<link rel="canonical" href="https://greenteapress.com/wp/" />
<link rel='shortlink' href='https://greenteapress.com/wp/' />
<link rel="alternate" type="application/json+oembed" href="https://greenteapress.com/wp/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fgreenteapress.com%2Fwp%2F" />
<link rel="alternate" type="text/xml+oembed" href="https://greenteapress.com/wp/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fgreenteapress.com%2Fwp%2F&#038;format=xml" />
<style type="text/css" id="custom-background-css">
body.custom-background { background-color: #f0f7ee; }
</style>
</head>

<body class="home page-template-default page page-id-6 custom-background wp-embed-responsive">
<div id="page" class="hfeed site">
	<a class="skip-link screen-reader-text" href="#content">Skip to content</a>

	<div id="sidebar" class="sidebar">
		<header id="masthead" class="site-header" role="banner">
			<div class="site-branding">
										<p class="site-title"><a href="https://greenteapress.com/wp/" rel="home">Green Tea Press</a></p>
												<p class="site-description">Free books by Allen B. Downey</p>
										<button class="secondary-toggle">Menu and widgets</button>
			</div><!-- .site-branding -->
		</header><!-- .site-header -->

			<div id="secondary" class="secondary">

		
		
					<div id="widget-area" class="widget-area" role="complementary">
				<aside id="search-2" class="widget widget_search"><form role="search" method="get" class="search-form" action="https://greenteapress.com/wp/">
				<label>
					<span class="screen-reader-text">Search for:</span>
					<input type="search" class="search-field" placeholder="Search &hellip;" value="" name="s" />
				</label>
				<input type="submit" class="search-submit screen-reader-text" value="Search" />
			</form></aside><aside id="text-2" class="widget widget_text"><h2 class="widget-title">Green Tea books also published by O&#8217;Reilly Media</h2>			<div class="textwidget"><p><a href="https://amzn.to/2QtIZO4">Think Complexity 2e</a><img style="border: none !important; margin: 0px !important;" src="http://www.assoc-amazon.com/e/ir?t=greenteapre01-20&amp;l=as2&amp;o=1&amp;a=1449314635" alt="" width="1" height="1" border="0" /></p>
<p><a href="http://www.amazon.com/gp/product/1449314635/ref=as_li_tf_il?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1449314635&amp;linkCode=as2&amp;tag=greenteapre01-20"><img src="http://ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&amp;ASIN=1449314635&amp;Format=_SL160_&amp;ID=AsinImage&amp;MarketPlace=US&amp;ServiceVersion=20070822&amp;WS=1&amp;tag=greenteapre01-20" border="0" /></a><img style="border: none !important; margin: 0px !important;" src="http://www.assoc-amazon.com/e/ir?t=greenteapre01-20&amp;l=as2&amp;o=1&amp;a=1449314635" alt="" width="1" height="1" border="0" /></p>
<p><a href="http://www.amazon.com/gp/product/1449370780/ref=as_li_qf_sp_asin_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1449370780&amp;linkCode=as2&amp;tag=greenteapre01-20">Think Bayes</a><img style="border: none !important; margin: 0px !important;" src="http://ir-na.amazon-adsystem.com/e/ir?t=greenteapre01-20&amp;l=as2&amp;o=1&amp;a=1449370780" alt="" width="1" height="1" border="0" /></p>
<p><a href="http://www.amazon.com/gp/product/1449370780/ref=as_li_qf_sp_asin_il?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1449370780&amp;linkCode=as2&amp;tag=greenteapre01-20"><img src="http://ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&amp;ASIN=1449370780&amp;Format=_SL160_&amp;ID=AsinImage&amp;MarketPlace=US&amp;ServiceVersion=20070822&amp;WS=1&amp;tag=greenteapre01-20" border="0" /></a><img style="border: none !important; margin: 0px !important;" src="http://ir-na.amazon-adsystem.com/e/ir?t=greenteapre01-20&amp;l=as2&amp;o=1&amp;a=1449370780" alt="" width="1" height="1" border="0" /></p>
<p><a href="http://www.amazon.com/gp/product/1491938455/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1491938455&amp;linkCode=as2&amp;tag=greenteapre01-20&amp;linkId=2JJH4SWCAVVYSQHO" rel="nofollow">Think DSP</a><img style="border: none !important; margin: 0px !important;" src="http://ir-na.amazon-adsystem.com/e/ir?t=greenteapre01-20&amp;l=as2&amp;o=1&amp;a=1491938455" alt="" width="1" height="1" border="0" /></p>
<p><a href="http://www.amazon.com/gp/product/1491938455/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1491938455&amp;linkCode=as2&amp;tag=greenteapre01-20&amp;linkId=CTV7PDT7E5EGGJUM" rel="nofollow"><img src="http://ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&amp;ASIN=1491938455&amp;Format=_SL160_&amp;ID=AsinImage&amp;MarketPlace=US&amp;ServiceVersion=20070822&amp;WS=1&amp;tag=greenteapre01-20" border="0" /></a><img style="border: none !important; margin: 0px !important;" src="http://ir-na.amazon-adsystem.com/e/ir?t=greenteapre01-20&amp;l=as2&amp;o=1&amp;a=1491938455" alt="" width="1" height="1" border="0" /></p>
<p><a href="http://www.amazon.com/gp/product/1491929561/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1491929561&amp;linkCode=as2&amp;tag=greenteapre01-20&amp;linkId=ZY6MAYM33ZTNSCNZ" rel="nofollow">Think Java</a><img style="border: none !important; margin: 0px !important;" src="http://ir-na.amazon-adsystem.com/e/ir?t=greenteapre01-20&amp;l=as2&amp;o=1&amp;a=1491929561" alt="" width="1" height="1" border="0" /></p>
<p><a href="http://www.amazon.com/gp/product/1491929561/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1491929561&amp;linkCode=as2&amp;tag=greenteapre01-20&amp;linkId=PT77ANWARUNNU3UK" rel="nofollow"><img src="http://ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&amp;ASIN=1491929561&amp;Format=_SL160_&amp;ID=AsinImage&amp;MarketPlace=US&amp;ServiceVersion=20070822&amp;WS=1&amp;tag=greenteapre01-20" border="0" /></a><img style="border: none !important; margin: 0px !important;" src="http://ir-na.amazon-adsystem.com/e/ir?t=greenteapre01-20&amp;l=as2&amp;o=1&amp;a=1491929561" alt="" width="1" height="1" border="0" /></p>
<p><a href="http://www.amazon.com/gp/product/1491939362/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1491939362&amp;linkCode=as2&amp;tag=greenteapre01-20&amp;linkId=FJKSQ3IHEMY2F2VA" rel="nofollow">Think Python 2e</a><img style="border: none !important; margin: 0px !important;" src="http://ir-na.amazon-adsystem.com/e/ir?t=greenteapre01-20&amp;l=as2&amp;o=1&amp;a=1491939362" alt="" width="1" height="1" border="0" /></p>
<p><a href="http://www.amazon.com/gp/product/1491939362/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1491939362&amp;linkCode=as2&amp;tag=greenteapre01-20&amp;linkId=ZZ454DLQ3IXDHNHX" rel="nofollow"><img src="http://ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&amp;ASIN=1491939362&amp;Format=_SL160_&amp;ID=AsinImage&amp;MarketPlace=US&amp;ServiceVersion=20070822&amp;WS=1&amp;tag=greenteapre01-20" border="0" /></a><img style="border: none !important; margin: 0px !important;" src="http://ir-na.amazon-adsystem.com/e/ir?t=greenteapre01-20&amp;l=as2&amp;o=1&amp;a=1491939362" alt="" width="1" height="1" border="0" /></p>
<p><a href="http://www.amazon.com/gp/product/1491907339/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1491907339&amp;linkCode=as2&amp;tag=greenteapre01-20&amp;linkId=O7WYM6H6YBYUFNWU">Think Stats 2e</a><img style="border: none !important; margin: 0px !important;" src="http://ir-na.amazon-adsystem.com/e/ir?t=greenteapre01-20&amp;l=as2&amp;o=1&amp;a=1491907339" alt="" width="1" height="1" border="0" /></p>
<p><a href="http://www.amazon.com/gp/product/1491907339/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1491907339&amp;linkCode=as2&amp;tag=greenteapre01-20&amp;linkId=JVSYKQHYSUIEYRHL"><img src="http://ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&amp;ASIN=1491907339&amp;Format=_SL160_&amp;ID=AsinImage&amp;MarketPlace=US&amp;ServiceVersion=20070822&amp;WS=1&amp;tag=greenteapre01-20" border="0" /></a><img style="border: none !important; margin: 0px !important;" src="http://ir-na.amazon-adsystem.com/e/ir?t=greenteapre01-20&amp;l=as2&amp;o=1&amp;a=1491907339" alt="" width="1" height="1" border="0" /></p>
<p><a href="https://www.amazon.com/gp/product/B073SJBWKD/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B073SJBWKD&amp;linkCode=as2&amp;tag=greenteapre01-20&amp;linkId=f8c4f1615642af804e1b22ab8003f4a3" target="_blank" rel="noopener">Think Data Structures</a><img style="border: none !important; margin: 0px !important;" src="//ir-na.amazon-adsystem.com/e/ir?t=greenteapre01-20&amp;l=am2&amp;o=1&amp;a=B073SJBWKD" alt="" width="1" height="1" border="0" /></p>
<p><a href="https://www.amazon.com/gp/product/B073SJBWKD/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B073SJBWKD&amp;linkCode=as2&amp;tag=greenteapre01-20&amp;linkId=8ad9e533d6ff1af9d2c9a41b529eab1c" target="_blank" rel="noopener"><img src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&amp;MarketPlace=US&amp;ASIN=B073SJBWKD&amp;ServiceVersion=20070822&amp;ID=AsinImage&amp;WS=1&amp;Format=_SL160_&amp;tag=greenteapre01-20" border="0" /></a><img style="border: none !important; margin: 0px !important;" src="//ir-na.amazon-adsystem.com/e/ir?t=greenteapre01-20&amp;l=am2&amp;o=1&amp;a=B073SJBWKD" alt="" width="1" height="1" border="0" /></p>
</div>
		</aside><aside id="custom_html-2" class="widget_text widget widget_custom_html"><div class="textwidget custom-html-widget">If you would like to make a contribution to support my books,
you can use the button below and pay with PayPal.  Thank you!

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="RAAYAZ7Y48S2A">
<table>
<tr><td><input type="hidden" name="on0" value="Pay what you want!">Choose an amount:</td></tr><tr><td><select name="os0">
	<option value="Small">Small $1.00 USD</option>
	<option value="Medium">Medium $5.00 USD</option>
	<option value="Large">Large $10.00 USD</option>
	<option value="X-Large">X-Large $20.00 USD</option>
	<option value="XX-Large">XX-Large $50.00 USD</option>
</select> </td></tr>
</table>
<input type="hidden" name="currency_code" value="USD">
<input type="image" src="https://www.paypalobjects.com/webstatic/en_US/i/buttons/PP_logo_h_100x26.png" border="0" name="submit" alt="PayPal">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
</div></aside>			</div><!-- .widget-area -->
		
	</div><!-- .secondary -->

	</div><!-- .sidebar -->

	<div id="content" class="site-content">

	<div id="primary" class="content-area">
		<main id="main" class="site-main" role="main">

		
<article id="post-6" class="post-6 page type-page status-publish hentry">
	
	<header class="entry-header">
		<h1 class="entry-title">Home</h1>	</header><!-- .entry-header -->

	<div class="entry-content">
		<p>Welcome to Green Tea Press, publisher of <i>Think Python</i>, <i>Think Bayes</i>, and other books by Allen Downey.</p>
<p>Read our <a href="http://greenteapress.com/wp/textbook-manifesto/">Textbook Manifesto</a>.</p>
<h3>Free Books!</h3>
<p>All of our books are available under free licenses that allow readers to copy and distribute the text; they are also free to modify it, which allows them to adapt the book to different needs, and to help develop new material.</p>
<p>These books are available in a variety of electronic formats; some are also for sale in hard copy.</p>
<h3>Available now</h3>
<p><a href="http://greenteapress.com/wp/think-python-2e/"><i>Think Python 2e: How To Think Like a Computer Scientist</i></a></p>
<p>An introduction to programming using Python, one of the best programming languages for beginners.  The second edition uses Python 3.</p>
<p><a href="http://greenteapress.com/wp/think-python/"><i>Think Python 1e: How To Think Like a Computer Scientist</i></a></p>
<p>The first edition of <em>Think Python</em>, using Python 2.</p>
<p><a href="http://greenteapress.com/wp/think-perl-6/"><em>Think Perl 6: How to Think Like a Computer Scientist</em></a></p>
<p>A new introduction to Perl 6 by Laurent Rosenfeld.</p>
<h3><i></i>Data Science in Python</h3>
<p><i></i><a href="http://greenteapress.com/thinkstats2/index.html"><i>Think Stats, 2nd Edition</i></a></p>
<p>An introduction to exploratory data analysis. Like the first edition, this book emphasizes simple computational tools for exploring real data. It includes several new topics, including regression, time series analysis and survival analysis. It presents basic use of NumPy, SciPy, pandas, and StatsModels.    This book revises and extends the first edition, <a href="http://greenteapress.com/thinkstats/index.html"><i>Think Stats: Probability and Statistics for Programmers</i></a></p>
<p><a href="http://greenteapress.com/wp/think-bayes/"><i>Think Bayes: Bayesian Statistics in Python</i></a></p>
<p>An introduction to Bayesian statistics using simple Python programs instead of complicated math.</p>
<p><a href="http://greenteapress.com/wp/think-dsp/"><i>Think DSP: Digital Signal Processing in Python</i></a></p>
<p>An introduction to digital signal processing with applications to sound and image processing.</p>
<p><a href="http://greenteapress.com/wp/think-complexity/"><i>Think Complexity 2e: Exploring Complexity Science with Python</i></a></p>
<p>An introduction to complexity science, which includes small world graphs, scale-free networks, cellular automata, fractals and pink noise, self-organized criticality, and agent-based models.</p>
<h3>Java</h3>
<p><a href="http://greenteapress.com/wp/think-java/"><i>Think Java: How To Think Like a Computer Scientist</i></a></p>
<p>New edition, revised and updated by <a href="https://w3.cs.jmu.edu/mayfiecs/">Chris Mayfield</a> and Allen Downey, and published by O&#8217;Reilly Media.</p>
<p><a href="http://greenteapress.com/wp/think-data-structures/"><em>Think Data Structures: Algorithms and Information Retrieval in Java</em></a></p>
<p>Build your own Web search engine—including a crawler, indexer, and search interface—while learning about data structures and algorithms in Java.</p>
<h3>Physical modeling</h3>
<p><a href="http://greenteapress.com/wp/modsimpy/"><em>Modeling and Simulation in Python</em></a></p>
<p>Models of discrete systems, like population growth, first-order systems, like epidemics and thermal systems, and second-order systems, like mechanical systems.  For people who have not programmed before.</p>
<p><a href="http://greenteapress.com/wp/physical-modeling-in-matlab/"><i>Physical Modeling in MATLAB</i></a></p>
<p>Use MATLAB to predict and explain the behavior of physical systems.  Intended for people with no programming experience.</p>
<h3>Operating systems</h3>
<p><a href="http://greenteapress.com/wp/think-os/"><i>Think OS: A Brief Introduction to Operating Systems</i></a></p>
<p>An introduction to Operating Systems for programmers. Uses the C programming language.</p>
<p><i><a href="http://greenteapress.com/semaphores/index.html">The Little Book of Semaphores</a></i></p>
<p>Learn about software synchronization by solving a series of puzzles.</p>
<h3>How to Think&#8230;</h3>
<p><i>How to Think Like a Computer Scientist</i> is an introductory programming book for people who have never programmed before, available for several programming languages:</p>
<p><a href="https://greenteapress.com/wp/think-c/"><i>Think C++: How To Think Like a Computer Scientist</i></a></p>
<p><a href="http://greenteapress.com/thinkocaml/index.html"><i>How To Think Like a (Functional) Programmer: OCaml Version</i></a></p>
<p><a href="http://greenteapress.com/thinkpython/pythonsd.html"><i>Python for Software Design: How To Think Like a Computer Scientist</i></a></p>
<p><i><a href="http://greenteapress.com/thinkpython/thinkCSpy/index.html">How To Think Like a Computer Scientist: Learning with Python</a><br />
</i>(this book has now been replaced by<i> Think Python</i>).</p>
<h3>About free books</h3>
<p>If you enjoy these books, please read about <a href="http://greenteapress.com/easy.html">Five Easy Ways to Help Promote Free Books</a>.</p>
<p>If you are thinking about writing a free book, here are reasons you should and suggestions about how: <a href="http://greenteapress.com/free_books.html">Free Books: Why Not?</a>.</p>
<p>The contents of this web site are available under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC BY-NC-SA 4.0</a>).</p>
			</div><!-- .entry-content -->

	
</article><!-- #post-6 -->

		</main><!-- .site-main -->
	</div><!-- .content-area -->


	</div><!-- .site-content -->

	<footer id="colophon" class="site-footer" role="contentinfo">
		<div class="site-info">
						<a class="privacy-policy-link" href="https://greenteapress.com/wp/privacy-policy/">Privacy Policy</a><span role="separator" aria-hidden="true"></span>			<a href="https://wordpress.org/" class="imprint">
				Proudly powered by WordPress			</a>
		</div><!-- .site-info -->
	</footer><!-- .site-footer -->

</div><!-- .site -->

<script type='text/javascript' src='https://greenteapress.com/wp/wp-content/themes/twentyfifteen/js/skip-link-focus-fix.js?ver=20141010'></script>
<script type='text/javascript'>
/* <![CDATA[ */
var screenReaderText = {"expand":"<span class=\"screen-reader-text\">expand child menu<\/span>","collapse":"<span class=\"screen-reader-text\">collapse child menu<\/span>"};
/* ]]> */
</script>
<script type='text/javascript' src='https://greenteapress.com/wp/wp-content/themes/twentyfifteen/js/functions.js?ver=20150330'></script>
<script type='text/javascript' src='https://greenteapress.com/wp/wp-includes/js/wp-embed.min.js?ver=5.0.4'></script>

</body>
</html>

<!-- Dynamic page generated in 0.390 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2019-07-25 04:50:30 -->

<!-- super cache -->
In [6]:
html_w_out_tags = get_text(response.text)
html_w_out_tags
Out[6]:
'                      (function(html){html.className = html.className.replace(/\\bno-js\\b/,\'js\')})(document.documentElement);   Green Tea Press &#8211; Free books by Allen B. Downey              window._wpemojiSettings = {"baseUrl":"https:\\/\\/s.w.org\\/images\\/core\\/emoji\\/11\\/72x72\\/","ext":".png","svgUrl":"https:\\/\\/s.w.org\\/images\\/core\\/emoji\\/11\\/svg\\/","svgExt":".svg","source":{"concatemoji":"https:\\/\\/greenteapress.com\\/wp\\/wp-includes\\/js\\/wp-emoji-release.min.js?ver=5.0.4"}}; !function(a,b,c){function d(a,b){var c=String.fromCharCode;l.clearRect(0,0,k.width,k.height),l.fillText(c.apply(this,a),0,0);var d=k.toDataURL();l.clearRect(0,0,k.width,k.height),l.fillText(c.apply(this,b),0,0);var e=k.toDataURL();return d===e}function e(a){var b;if(!l||!l.fillText)return!1;switch(l.textBaseline="top",l.font="600 32px Arial",a){case"flag":return!(b=d([55356,56826,55356,56819],[55356,56826,8203,55356,56819]))&&(b=d([55356,57332,56128,56423,56128,56418,56128,56421,56128,56430,56128,56423,56128,56447],[55356,57332,8203,56128,56423,8203,56128,56418,8203,56128,56421,8203,56128,56430,8203,56128,56423,8203,56128,56447]),!b);case"emoji":return b=d([55358,56760,9792,65039],[55358,56760,8203,9792,65039]),!b}return!1}function f(a){var c=b.createElement("script");c.src=a,c.defer=c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var g,h,i,j,k=b.createElement("canvas"),l=k.getContext&&k.getContext("2d");for(j=Array("flag","emoji"),c.supports={everything:!0,everythingExceptFlag:!0},i=0;i    img.wp-smiley, img.emoji { display: inline !important; border: none !important; box-shadow: none !important; height: 1em !important; width: 1em !important; margin: 0 .07em !important; vertical-align: -0.1em !important; background: none !important; padding: 0 !important; }               /* Custom Header Background Color */ body:before, .site-header { background-color: #aeccc5; } @media screen and (min-width: 59.6875em) { .site-header, .secondary { background-color: transparent; } .widget button, .widget input[type="button"], .widget input[type="reset"], .widget input[type="submit"], .widget_calendar tbody a, .widget_calendar tbody a:hover, .widget_calendar tbody a:focus { color: #aeccc5; } } /* Custom Sidebar Text Color */ .site-title a, .site-description, .secondary-toggle:before { color: #002500; } .site-title a:hover, .site-title a:focus { color: #002500; /* Fallback for IE7 and IE8 */ color: rgba( 0, 37, 0, 0.7); } .secondary-toggle { border-color: #002500; /* Fallback for IE7 and IE8 */ border-color: rgba( 0, 37, 0, 0.1); } .secondary-toggle:hover, .secondary-toggle:focus { border-color: #002500; /* Fallback for IE7 and IE8 */ border-color: rgba( 0, 37, 0, 0.3); } .site-title a { outline-color: #002500; /* Fallback for IE7 and IE8 */ outline-color: rgba( 0, 37, 0, 0.3); } @media screen and (min-width: 59.6875em) { .secondary a, .dropdown-toggle:after, .widget-title, .widget blockquote cite, .widget blockquote small { color: #002500; } .widget button, .widget input[type="button"], .widget input[type="reset"], .widget input[type="submit"], .widget_calendar tbody a { background-color: #002500; } .textwidget a { border-color: #002500; } .secondary a:hover, .secondary a:focus, .main-navigation .menu-item-description, .widget, .widget blockquote, .widget .wp-caption-text, .widget .gallery-caption { color: rgba( 0, 37, 0, 0.7); } .widget button:hover, .widget button:focus, .widget input[type="button"]:hover, .widget input[type="button"]:focus, .widget input[type="reset"]:hover, .widget input[type="reset"]:focus, .widget input[type="submit"]:hover, .widget input[type="submit"]:focus, .widget_calendar tbody a:hover, .widget_calendar tbody a:focus { background-color: rgba( 0, 37, 0, 0.7); } .widget blockquote { border-color: rgba( 0, 37, 0, 0.7); } .main-navigation ul, .main-navigation li, .secondary-toggle, .widget input, .widget textarea, .widget table, .widget th, .widget td, .widget pre, .widget li, .widget_categories .children, .widget_nav_menu .sub-menu, .widget_pages .children, .widget abbr[title] { border-color: rgba( 0, 37, 0, 0.1); } .dropdown-toggle:hover, .dropdown-toggle:focus, .widget hr { background-color: rgba( 0, 37, 0, 0.1); } .widget input:focus, .widget textarea:focus { border-color: rgba( 0, 37, 0, 0.3); } .sidebar a:focus, .dropdown-toggle:focus { outline-color: rgba( 0, 37, 0, 0.3); } }                                         body.custom-background { background-color: #f0f7ee; }          Skip to content          Green Tea Press    Free books by Allen B. Downey   Menu and widgets                  Search for:            Green Tea books also published by O&#8217;Reilly Media     Think Complexity 2e             Think Bayes             Think DSP             Think Java             Think Python 2e             Think Stats 2e             Think Data Structures                If you would like to make a contribution to support my books, you can use the button below and pay with PayPal. Thank you!            Choose an amount:       Small $1.00 USD   Medium $5.00 USD   Large $10.00 USD   X-Large $20.00 USD   XX-Large $50.00 USD                                        Home        Welcome to Green Tea Press, publisher of  Think Python ,  Think Bayes , and other books by Allen Downey.   Read our  Textbook Manifesto .   Free Books!   All of our books are available under free licenses that allow readers to copy and distribute the text; they are also free to modify it, which allows them to adapt the book to different needs, and to help develop new material.   These books are available in a variety of electronic formats; some are also for sale in hard copy.   Available now     Think Python 2e: How To Think Like a Computer Scientist     An introduction to programming using Python, one of the best programming languages for beginners. The second edition uses Python 3.     Think Python 1e: How To Think Like a Computer Scientist     The first edition of  Think Python , using Python 2.     Think Perl 6: How to Think Like a Computer Scientist     A new introduction to Perl 6 by Laurent Rosenfeld.     Data Science in Python       Think Stats, 2nd Edition     An introduction to exploratory data analysis. Like the first edition, this book emphasizes simple computational tools for exploring real data. It includes several new topics, including regression, time series analysis and survival analysis. It presents basic use of NumPy, SciPy, pandas, and StatsModels. This book revises and extends the first edition,   Think Stats: Probability and Statistics for Programmers       Think Bayes: Bayesian Statistics in Python     An introduction to Bayesian statistics using simple Python programs instead of complicated math.     Think DSP: Digital Signal Processing in Python     An introduction to digital signal processing with applications to sound and image processing.     Think Complexity 2e: Exploring Complexity Science with Python     An introduction to complexity science, which includes small world graphs, scale-free networks, cellular automata, fractals and pink noise, self-organized criticality, and agent-based models.   Java     Think Java: How To Think Like a Computer Scientist     New edition, revised and updated by  Chris Mayfield  and Allen Downey, and published by O&#8217;Reilly Media.     Think Data Structures: Algorithms and Information Retrieval in Java     Build your own Web search engine—including a crawler, indexer, and search interface—while learning about data structures and algorithms in Java.   Physical modeling     Modeling and Simulation in Python     Models of discrete systems, like population growth, first-order systems, like epidemics and thermal systems, and second-order systems, like mechanical systems. For people who have not programmed before.     Physical Modeling in MATLAB     Use MATLAB to predict and explain the behavior of physical systems. Intended for people with no programming experience.   Operating systems     Think OS: A Brief Introduction to Operating Systems     An introduction to Operating Systems for programmers. Uses the C programming language.     The Little Book of Semaphores     Learn about software synchronization by solving a series of puzzles.   How to Think&#8230;    How to Think Like a Computer Scientist  is an introductory programming book for people who have never programmed before, available for several programming languages:     Think C++: How To Think Like a Computer Scientist       How To Think Like a (Functional) Programmer: OCaml Version       Python for Software Design: How To Think Like a Computer Scientist       How To Think Like a Computer Scientist: Learning with Python    (this book has now been replaced by  Think Python ).   About free books   If you enjoy these books, please read about  Five Easy Ways to Help Promote Free Books .   If you are thinking about writing a free book, here are reasons you should and suggestions about how:  Free Books: Why Not? .   The contents of this web site are available under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International ( CC BY-NC-SA 4.0 ).                      Privacy Policy      Proudly powered by WordPress                 /*  expand child menu ","collapse":" collapse child menu "}; /* ]]> */                  '
In [8]:
"Think" in html_w_out_tags
Out[8]:
True

I want to try running another regex thingy mabob.

In [9]:
code_on_page = re.sub(r'}','blarg',html_w_out_tags)
In [10]:
list_of_code_from_page_split_by_blarg = code_on_page.split('blarg')
In [11]:
list_of_code_from_page_split_by_blarg[-2]
Out[11]:
'          Skip to content          Green Tea Press    Free books by Allen B. Downey   Menu and widgets                  Search for:            Green Tea books also published by O&#8217;Reilly Media     Think Complexity 2e             Think Bayes             Think DSP             Think Java             Think Python 2e             Think Stats 2e             Think Data Structures                If you would like to make a contribution to support my books, you can use the button below and pay with PayPal. Thank you!            Choose an amount:       Small $1.00 USD   Medium $5.00 USD   Large $10.00 USD   X-Large $20.00 USD   XX-Large $50.00 USD                                        Home        Welcome to Green Tea Press, publisher of  Think Python ,  Think Bayes , and other books by Allen Downey.   Read our  Textbook Manifesto .   Free Books!   All of our books are available under free licenses that allow readers to copy and distribute the text; they are also free to modify it, which allows them to adapt the book to different needs, and to help develop new material.   These books are available in a variety of electronic formats; some are also for sale in hard copy.   Available now     Think Python 2e: How To Think Like a Computer Scientist     An introduction to programming using Python, one of the best programming languages for beginners. The second edition uses Python 3.     Think Python 1e: How To Think Like a Computer Scientist     The first edition of  Think Python , using Python 2.     Think Perl 6: How to Think Like a Computer Scientist     A new introduction to Perl 6 by Laurent Rosenfeld.     Data Science in Python       Think Stats, 2nd Edition     An introduction to exploratory data analysis. Like the first edition, this book emphasizes simple computational tools for exploring real data. It includes several new topics, including regression, time series analysis and survival analysis. It presents basic use of NumPy, SciPy, pandas, and StatsModels. This book revises and extends the first edition,   Think Stats: Probability and Statistics for Programmers       Think Bayes: Bayesian Statistics in Python     An introduction to Bayesian statistics using simple Python programs instead of complicated math.     Think DSP: Digital Signal Processing in Python     An introduction to digital signal processing with applications to sound and image processing.     Think Complexity 2e: Exploring Complexity Science with Python     An introduction to complexity science, which includes small world graphs, scale-free networks, cellular automata, fractals and pink noise, self-organized criticality, and agent-based models.   Java     Think Java: How To Think Like a Computer Scientist     New edition, revised and updated by  Chris Mayfield  and Allen Downey, and published by O&#8217;Reilly Media.     Think Data Structures: Algorithms and Information Retrieval in Java     Build your own Web search engine—including a crawler, indexer, and search interface—while learning about data structures and algorithms in Java.   Physical modeling     Modeling and Simulation in Python     Models of discrete systems, like population growth, first-order systems, like epidemics and thermal systems, and second-order systems, like mechanical systems. For people who have not programmed before.     Physical Modeling in MATLAB     Use MATLAB to predict and explain the behavior of physical systems. Intended for people with no programming experience.   Operating systems     Think OS: A Brief Introduction to Operating Systems     An introduction to Operating Systems for programmers. Uses the C programming language.     The Little Book of Semaphores     Learn about software synchronization by solving a series of puzzles.   How to Think&#8230;    How to Think Like a Computer Scientist  is an introductory programming book for people who have never programmed before, available for several programming languages:     Think C++: How To Think Like a Computer Scientist       How To Think Like a (Functional) Programmer: OCaml Version       Python for Software Design: How To Think Like a Computer Scientist       How To Think Like a Computer Scientist: Learning with Python    (this book has now been replaced by  Think Python ).   About free books   If you enjoy these books, please read about  Five Easy Ways to Help Promote Free Books .   If you are thinking about writing a free book, here are reasons you should and suggestions about how:  Free Books: Why Not? .   The contents of this web site are available under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International ( CC BY-NC-SA 4.0 ).                      Privacy Policy      Proudly powered by WordPress                 /*  expand child menu ","collapse":" collapse child menu "'

reading tutorial...

In [45]:
# this is basically what the tutorial showed me
# but I'm writing it in my own code

text_from_gtp_homepage = list_of_code_from_page_split_by_blarg[-2]
text_list = text_from_gtp_homepage.split()
pattern = re.compile(r'Think', re.I) 
# apparently '.I' makes sure that the pattern 
# being searched is case insensitive. is that right? 
# it's finding any combination regardless of upper or lower
# case variations
count = 0

for word in text_list: # this will be the number of iterations
    if pattern.search(word): # if the pattern defined above is found
        count += 1
    
print(count)

# ~~~~~~~~what's happening at the for loop~~~~~~
# this will be the number of iterations thru string_list
# if the pattern defined above is found when searching the iterable
# add 1 to count
# print how many times it's been found
34

what's that '34' mean? It means that there are 34 instances of the word 'Think' on that page, regardless if 'Think' is made up of capital or non-capital letters.

Alright so here's for the long awaited write up.

I basically did what I wanted to always do today. Just mess around with a library I know nothing about and get some know how in it. I barely did but tomorrow I'll get just a bit more and the next day and so on.

What I really wanted to say about this was that I like building things like this. Yesterday's workflow and this one connect. Obviously there's better ways to do some of what I did here and yesterday's workflow too but it's just about messing stuff up and seeing what I can create.

Today I also worked on my site a bunch too.