Description:
In this tutorial we will crawl quotes from Star Wars The clone wars, clean the format and automate a daily random email.
Activities included in this tutorial:
Theme: Starwars, python
The website is from mytowntutors.com : quotes link
In [1]:
import webbrowser
import requests
import bs4
import csv
import pandas as pd
res = requests.get('http://mytowntutors.com/2014/04/star-wars-the-clone-wars/')
print(res.status_code == requests.codes.ok)
print("Number of lines in te downloaded page: %i"%len(res.text))
print("The first 20 thousand lines for a quick assesment. Hint: by using the finder it will give you an idea of the tags related to the info.")
print(res.text[:20000]) # quick assesment
True
Number of lines in te downloaded page: 21122
The first 20 thousand lines for a quick assesment. Hint: by using the finder it will give you an idea of the tags related to the info.
<!DOCTYPE html>
<html dir="ltr" lang="en-US">
<head>
<meta charset="UTF-8" />
<title>Star Wars The Clone Wars: 98 Clone Wars Quotes | My Town Tutors</title>
<link rel="stylesheet" type="text/css" media="all" href="http://mytowntutors.com/wp-content/themes/mytowntutor/style.css" />
<link rel="pingback" href="http://mytowntutors.com/xmlrpc.php" />
<link rel="alternate" type="application/rss+xml" title="My Town Tutors » Feed" href="http://mytowntutors.com/feed/" />
<link rel="alternate" type="application/rss+xml" title="My Town Tutors » Comments Feed" href="http://mytowntutors.com/comments/feed/" />
<script type='text/javascript' src='http://mytowntutors.com/wp-includes/js/l10n.js?ver=20101110'></script>
<script type='text/javascript' src='http://mytowntutors.com/wp-includes/js/comment-reply.js?ver=20090102'></script>
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://mytowntutors.com/xmlrpc.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://mytowntutors.com/wp-includes/wlwmanifest.xml" />
<link rel='index' title='My Town Tutors' href='http://mytowntutors.com/' />
<link rel='start' title='P is the Kindergarten “Letter of the Week”' href='http://mytowntutors.com/2011/01/p-is-the-kindergarten-letter-of-the-week/' />
<link rel='prev' title='Social Media: 5 Goals of a Tweet' href='http://mytowntutors.com/2014/04/social-media-5-goals-of-a-tweet/' />
<link rel='next' title='Top 10 Quotes for Teachers: Translated By Yoda' href='http://mytowntutors.com/2014/04/top-10-quotes-for-teachers-translated-by-yoda/' />
<meta name="generator" content="WordPress 3.1.4" />
<link rel='shortlink' href='http://mytowntutors.com/?p=31713' />
<!-- All in One SEO Pack 1.6.13.3 by Michael Torbert of Semper Fi Web Design[82,152] -->
<meta name="description" content="Star Wars: The Clone Wars. Star Wars The Clone Wars: 98 Clone Wars Quotes" />
<meta name="keywords" content="star wars: the clone wars, star wars the clone wars: 98 clone wars quotes,star wars the clone wars: 98 clone wars quotes" />
<link rel="canonical" href="http://mytowntutors.com/2014/04/star-wars-the-clone-wars/" />
<!-- /all in one seo pack -->
<script type="text/javascript" src="http://mytowntutors.com/wp-content/themes/mytowntutor/js/jquery.tools.min.js"></script>
<script type="text/javascript" src="http://mytowntutors.com/wp-content/themes/mytowntutor/js/cufon-yui.js"></script>
<script type="text/javascript" src="http://mytowntutors.com/wp-content/themes/mytowntutor/js/Eraser_500.font.js"></script>
<script type="text/javascript">
// Cufon.replace('body');
Cufon('#nav a', {
hover: {
color: '#ffc'
}
});
</script>
<script type="text/javascript">
function clearText(thefield){
if (thefield.defaultValue==thefield.value) thefield.value = "";
}
function resetText(thefield){
if (thefield.value=="") thefield.value = thefield.defaultValue;
}
function resetFormElements(oForm, sType){
var aElems = oForm.elements;
for (var iI=0;iI<aElems.length-3;iI++){
if (aElems[iI].type = sType) aElems[iI].checked = false;
}
}
</script>
</head>
<body>
<div id="headerwrap">
<div id="header">
<div id="notlogged">
<a href="http://mytowntutors.com/login">Tutor Login »</a>
</div>
<div id="logo">
<a href="http://mytowntutors.com"><img src="http://mytowntutors.com/wp-content/themes/mytowntutor/images/logo.png" alt="MyTownTutor Logo" /></a>
</div>
<div id="topsearch">
<form action="http://mytowntutors.com/find-a-tutor/" method="post">
<ul>
<li><strong>Find a tutor in your area:</strong></li>
<li><input type="text" name="zip" value="Zip Code" onFocus="clearText(this)" onBlur="resetText(this)" class="field" /></li>
<li>
<select name="range">
<option value="15">15 Miles</option>
<option value="5">5 Miles</option>
<option value="10">10 Miles</option>
<option value="20">20 Miles</option>
<option value="25">25 Miles</option>
</select>
</li>
<li><input type="submit" name="search" value="Find" class="button" /></li>
</ul>
</form>
</div>
</div>
</div>
<div id="navwrap">
<div id="nav">
<div id="social">
<a href="https://www.facebook.com/pages/My-Town-Tutors/231169106897790"><img src="http://mytowntutors.com/wp-content/themes/mytowntutor/images/facebook.png" alt="Follow Us on Facebook" /></a>
<a href="https://twitter.com/#!/mytowntutors"><img src="http://mytowntutors.com/wp-content/themes/mytowntutor/images/twitter.png" alt="Follow Us on Twitter" /></a>
<a href="http://www.linkedin.com/in/wwwmytowntutorscom"><img src="http://mytowntutors.com/wp-content/themes/mytowntutor/images/linkedin.png" alt="LinkedIn" /></a>
<a href="http://www.delicious.com/?view=fresh"><img src="http://mytowntutors.com/wp-content/themes/mytowntutor/images/delicious.png" alt="Delicious" /></a>
<a href="http://mytowntutors.com/feed/"><img src="http://mytowntutors.com/wp-content/themes/mytowntutor/images/rss.png" alt="Subscribe to our RSS Feed" /></a>
</div>
<ul>
<li class="page_item page-item-2"><a href="http://mytowntutors.com/sample-page/" title="About Us">About Us</a></li>
<li class="page_item page-item-8"><a href="http://mytowntutors.com/become-a-tutor/" title="Become A Tutor">Become A Tutor</a></li>
<li class="page_item page-item-10"><a href="http://mytowntutors.com/blog/" title="My Town Tutors Blog">Blog</a></li>
<li class="page_item page-item-7038"><a href="http://mytowntutors.com/coaching-youth-basketball/" title="Coaching Youth Basketball">Coaching Youth Basketball</a></li>
<li class="page_item page-item-6"><a href="http://mytowntutors.com/find-a-tutor/" title="FINd A Tutor">FINd A Tutor</a></li>
<li class="page_item page-item-94"><a href="http://mytowntutors.com/guest-bloggers/" title="Guest blogs">Guest Blogs</a></li>
<li class="page_item page-item-196"><a href="http://mytowntutors.com/parent-pages/" title="Parent Pages">Parent Pages</a></li>
<li class="page_item page-item-30963"><a href="http://mytowntutors.com/support-our-sponsors/" title="Support our Sponsors">Support our Sponsors</a></li>
<li class="page_item page-item-23692"><a href="http://mytowntutors.com/teacher-resources/" title="Teacher Resources">Teacher Resources</a></li>
<li class="page_item page-item-236"><a href="http://mytowntutors.com/testimonials/" title="Testimonials">Testimonials</a></li>
<li class="page_item page-item-44170"><a href="http://mytowntutors.com/tutoring/" title="Tutoring">Tutoring</a></li>
<li class="page_item page-item-50183"><a href="http://mytowntutors.com/worlds-best-jokes/" title="World's Best Jokes">World’s Best Jokes</a></li>
<li><a href="http://mytowntutors.com/promote">Promote MTT</a></li>
</ul>
</div>
</div>
<div id="content">
<div id="sidebar">
<div id="randomtutor">
<h2>Mary Carrig<span>, </span></h2>
<img src="http://mytowntutors.com/images/tutors/missing.jpg" alt="Mary Carrig" />
<ul>
<li><label>School:</label><span>Thomas E. Willett School</span></li>
<li><label>About Mary:</label><p>Special Education Teacher trained in Lindamood Bell Lips, Wilson Reading System, Project Read and Write Traits.</p></li>
</ul>
<a href="http://mytowntutors.com/tutors/136/mary-carrig-02703" class="button">More Info »</a>
</div>
</div>
<div id="breadcrumb">
<a href="http://mytowntutors.com">My Town Tutors</a> » <a href="http://mytowntutors.com/category/latest-news/" title="View all posts in Latest News" rel="category tag">Latest News</a> » Star Wars The Clone Wars: 98 Clone Wars Quotes
</div>
<div id="main">
<div id="post-31713" class="post-31713 post type-post status-publish format-standard hentry category-latest-news tag-star-wars-the-clone-wars-98-clone-wars-quotes tag-star-wars-the-clone-wars">
<h1 class="entry-title">Star Wars The Clone Wars: 98 Clone Wars Quotes</h1>
<div class="entry-meta">
<span class="meta-prep meta-prep-author">Posted on</span> <a href="http://mytowntutors.com/2014/04/star-wars-the-clone-wars/" title="7:44 pm" rel="bookmark"><span class="entry-date">April 26, 2014</span></a> <span class="meta-sep">by</span> <span class="author vcard"><a class="url fn n" href="http://mytowntutors.com/author/" title="View all posts by "></a></span> </div><!-- .entry-meta -->
<div class="entry-content">
<p>Each episode starts with an inspirational quote / lesson. We included the title of the episode and the quote.</p>
<p>May the Force be with you!</p>
<p><em><strong>Please Share!</strong></em></p>
<p><a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.mytowntutors.com/2014/04/star-wars-the-clone-wars/" data-text="#StarWars The Clone Wars: 98 Clone Wars Quotes" data-via="MyTownTutors" data-hashtags="Maythe4th">Tweet</a><br />
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script></p>
<p> </p>
<p>Season One</p>
<ol>
<li>Ambush: “Great leaders inspire greatness in others.”</li>
<li>Rising Malevolence: “Belief is not a matter of choice, but conviction.”</li>
<li>Shadow of Malevolence: “Easy is the path to wisdom for those not blinded by ego.”</li>
<li>Destroy Malevolence: “A plan is only as good as those who see it through.”</li>
<li>Rookies: “The best confidence builder is experience.”</li>
<li>Downfall of a Droid: “Trust in your friends, and they’ll have reason to trust in you.”</li>
<li>Duel of the Droids: “You hold onto your friends by keeping your heart a little softer than you head.”</li>
<li>Bombad Jedi: “Heroes are made by the times.”</li>
<li>Cloak of Darkness: “Ignore your instincts at your peril.”</li>
<li>Lair of Grievous: “Most powerful is he who controls his own power.”</li>
<li>Dooku Captured: “The winding path to peace is always a worthy one, regardless of how many turns it takes.”</li>
<li>The Gungan General: “Fail with honor rather than succeed with fraud.”</li>
<li>Jedi Crash: “Greed and fear of loss are the roots that lead to the tree of evil.”</li>
<li>Defenders of Peace: “When surrounded by war, one must eventually choose a side.”</li>
<li>Trespass: “Arrogance diminishes wisdom.”</li>
<li>The Hidden Enemy: “Truth enlightens the mind, but won’t always bring happiness to your heart.”</li>
<li>Blue Shadow Virus: “Fear is a disease; hope is its only cure.”</li>
<li>Mystery of a Thousand Moons: “A single chance is a galaxy of hope.”</li>
<li>Storm Over Ryloth: “It is a rough road that leads to the heights of greatness.”</li>
<li>Innocents of Ryloth: “The costs of war can never be truly accounted for.”</li>
<li>Liberty on Ryloth: “Compromise is a virtue to be cultivated, not a weakness to be despised.”</li>
<li>Hostage Crisis: “A secret shared is a trust formed.”</li>
</ol>
<p>Season Two</p>
<ol>
<li>Holocron Heist: “A lesson learned is a lesson earned.”</li>
<li>Cargo of Doom: “Overconfidence is the most dangerous form of carelessness.”</li>
<li>Children of the Force: “The first step to correcting a mistake is patience.”</li>
<li>Senate Spy: “A true heart should never be doubted.”</li>
<li>Landing at Point Rain: “Believe in yourself or no one else will.”</li>
<li>Weapons Factory: “No gift is more precious than trust.”</li>
<li>Legacy of Terror: “Sometimes, accepting help is harder than offering it.”</li>
<li>Brain Invaders: “Attachment is not compassion”</li>
<li>Grievous Intrigue: “For everything you gain, you lose something else.”</li>
<li>The Deserter: “It is the quest for honor that makes one honorable.”</li>
<li>Lightsaber Lost: “Easy isn’t always simple.”</li>
<li>The Mandalore Plot: “If you ignore the past, you jeopardize your future.”</li>
<li>Voyage of Temptation: “Fear not for the future, weep not for the past.”</li>
<li>Duchess of Mandalore: “In war, truth is the first casualty.”</li>
<li>Senate Murders: “Searching for the truth is easy. Accepting the truth is hard.”</li>
<li>Cat and Mouse: “A wise leader knows when to follow.”</li>
<li>Bounty Hunters: “Courage makes heroes, but trust builds friendship.”</li>
<li>The Zillo Beast: “Choose what is right, not what is easy”</li>
<li>The Zillo Beast Strikes Back: “The most dangerous beast is the beast within.”</li>
<li>Death Trap: “Who my father was matters less than my memory of him.”</li>
<li>R2 Come Home: “Adversity is friendship’s truest test.”</li>
<li>Lethal Trackdown: “Revenge is a confession of pain.”</li>
</ol>
<p>Season Three</p>
<ol>
<li>Clone Cadets: “Brothers in arms are brothers for life.”</li>
<li>ARC Troopers: “Fighting a war tests a soldier’s skills, defending his home tests a soldier’s heart.”</li>
<li>Supply Lines: “Where there’s a will, there’s a way.”</li>
<li>Sphere of Influence: “A child stolen is a lost hope.”</li>
<li>Corruption: “The challenge of hope is to overcome corruption.”</li>
<li>The Academy: “Those who enforce the law must obey the law.”</li>
<li>Assassin: “The future has many paths — choose wisely.”</li>
<li>Evil Plans: “A failure in planning is a plan for failure.”</li>
<li>Hunt for Ziro: “Love comes in all shapes and sizes.”</li>
<li>Heroes on Both Sides: “Fear is a great motivator.”</li>
<li>Pursuit of Peace: “Truth can strike down the specter of fear”</li>
<li>Nightsisters: “The swiftest path to destruction is through vengeance.”</li>
<li>Monster: “Evil is not born, it is taught.”</li>
<li>Witches of the Mist: “The path to evil may bring great power, but not loyalty.”</li>
<li>Overlords: “Balance is found in the one who faces his guilt.”</li>
<li>Altar of Mortis: “He who surrenders hope, surrenders life.”</li>
<li>Ghosts of Mortis: “He who seeks to control fate shall never find peace.”</li>
<li>The Citadel: “Adaptation is the key to survival.”</li>
<li>Counterattack: “Anything that can go wrong will.”</li>
<li>Citadel Rescue: “Without honor, victory is hollow.”</li>
<li>Padawan Lost: “Without humility, courage is a dangerous game.”</li>
<li>Wookiee Hunt: “A great student is what the teacher hopes to be.”</li>
</ol>
<p>Season Four</p>
<ol>
<li>Water wars: “When destiny calls, the chosen have no choice.”</li>
<li>Gungan Attack: “Only through fire is a strong sword forged.”</li>
<li>Prisoners: “Crowns are inherited, kingdoms are earned.”</li>
<li>Shadow Warrior: “Who a person truly is cannot be seen with the eye.”</li>
<li>Mercy Mission: “Understanding is honoring the truth beneath the surface.”</li>
<li>Nomad Droids: “Who’s the more foolish, the fool or the fool who follows him?”</li>
<li>Darkness on Umbara: “The first step toward loyalty is trust.”</li>
<li>The General: “The path of ignorance is guided by fear.”</li>
<li>Plan of Dissent: “The wise man leads, the strong man follows.”</li>
<li>Carnage of Krell: Our actions define our legacy.”</li>
<li>Kidnapped: “Where we are going always reflects where we came from.”</li>
<li>Slaves of the Republic: “Those who enslave others inevitably become slaves themselves.”</li>
<li>Escape from Kadavo: “Great hope can come from small sacrifices.”</li>
<li>A Friend in Need: “Friendship shows us who we really are.”</li>
<li>Deception: “All warfare is based on deception.”</li>
<li>Friends and Enemies: “Keep your friends close, but keep your enemies closer.”</li>
<li>The Box: “The strong survive, the noble overcome.”</li>
<li>Crisis on Naboo: “Trust is the greatest of gifts, but it must be earned.”</li>
<li>Massacre: “One must let go of the past to hold onto the future.”</li>
<li>Bounty: “Who we are never changes, who we think we are does.”</li>
<li>Brothers: “A fallen enemy may rise again, but the reconciled one is truly vanquished.”</li>
<li>Revenge: “The enemy of my enemy is my friend.”</li>
</ol>
<p>Season Five</p>
<ol>
<li>Revival: “Strength in character can defeat strength in numbers.”</li>
<li>A War on Two Fronts: “Fear is a malleable weapon.”</li>
<li>Front Runners: “To seek something is to believe in its possibility.”</li>
<li>The Soft War: “Struggles often begin and end with the truth.”</li>
<li>Tipping Points: “Disobedience is a demand for change.”</li>
<li>The Gathering: “He who faces himself, finds himself.”</li>
<li>A Test of Strength: “The young are often underestimated.”</li>
<li>Bound for Rescue: “When we rescue others, we rescue ourselves.”</li>
<li>A Necessary Bond: “Choose your enemies wisely, as they may be your last hope.”</li>
<li>Secret Weapons: “Humility is the only defense against humiliation.”</li>
<li>A Sunny Day in the Void: “When all seems hopeless, a true hero gives hope.”</li>
<li>Missing in Action: “A soldier’s most powerful weapon is courage.”</li>
<li>Point of No Return: “You must trust in others or success is impossible.”</li>
<li>Eminence: “One vision can have many interpretations.”</li>
<li>Shades of Reason: “Alliances can stall true intentions.”</li>
<li>The Lawless: “Morality separates heroes from villains.”</li>
<li>Sabotage: “Sometimes even the smallest doubt can shake the greatest belief.”</li>
<li>The Jedi who knew too much: “Courage begins by trusting oneself.”</li>
<li>To catch a Jedi: “Never become desperate enough to trust the untrustworthy.”</li>
<li>The Wrong Jedi: Never give up hope, no matter how dark things seem.”</li>
</ol>
</div><!-- .entry-content -->
</div><!-- #post-## -->
<div id="comments">
<p class="nocomments">Comments are closed.</p>
</div><!-- #comments -->
</div><!-- #content -->
</div>
<div id="footwrap">
<div id="footer">
<div id="footlogo">
<p>MTT, LLC<br />112 Ashburton Ave<br />Marshfield, MA 02050<br />(617) 851.6106 <br /><a href="mailto:info@mytowntutor.com">info@mytowntutor.com</a></p>
</div>
<div id="footlinks">
<ul>
<li class="first"><a href="h
In [2]:
starwars_website = bs4.BeautifulSoup(res.text)
starwars_quotes = starwars_website.select('li')
print("Number of elements that have li tag" + str(len(starwars_quotes)));
starwars_quotes[126].getText(); # Since the quotes are together we need to find the first
# quote and the last. In this case were 19 and 127 respectively
starwar_quotes_selected = []
for quote in starwars_quotes[19:127]:
starwar_quotes_selected.append(quote.getText())
starwar_quotes_selected
Number of elements that have li tag132
Out[2]:
[u'Ambush: \u201cGreat leaders inspire greatness in others.\u201d',
u'Rising Malevolence: \u201cBelief is not a matter of choice, but conviction.\u201d',
u'Shadow of Malevolence: \u201cEasy is the path to wisdom for those not blinded by ego.\u201d',
u'Destroy Malevolence: \u201cA plan is only as good as those who see it through.\u201d',
u'Rookies: \u201cThe best confidence builder is experience.\u201d',
u'Downfall of a Droid: \u201cTrust in your friends, and they\u2019ll have reason to trust in you.\u201d',
u'Duel of the Droids: \u201cYou hold onto your friends by keeping your heart a little softer than you head.\u201d',
u'Bombad Jedi: \u201cHeroes are made by the times.\u201d',
u'Cloak of Darkness: \u201cIgnore your instincts at your peril.\u201d',
u'Lair of Grievous: \u201cMost powerful is he who controls his own power.\u201d',
u'Dooku Captured: \u201cThe winding path to peace is always a worthy one, regardless of how many turns it takes.\u201d',
u'The Gungan General: \u201cFail with honor rather than succeed with fraud.\u201d',
u'Jedi Crash: \u201cGreed and fear of loss are the roots that lead to the tree of evil.\u201d',
u'Defenders of Peace: \u201cWhen surrounded by war, one must eventually choose a side.\u201d',
u'Trespass: \u201cArrogance diminishes wisdom.\u201d',
u'The Hidden Enemy: \u201cTruth enlightens the mind, but won\u2019t always bring happiness to your heart.\u201d',
u'Blue Shadow Virus: \u201cFear is a disease; hope is its only cure.\u201d',
u'Mystery of a Thousand Moons: \u201cA single chance is a galaxy of hope.\u201d',
u'Storm Over Ryloth: \u201cIt is a rough road that leads to the heights of greatness.\u201d',
u'Innocents of Ryloth: \u201cThe costs of war can never be truly accounted for.\u201d',
u'Liberty on Ryloth: \u201cCompromise is a virtue to be cultivated, not a weakness to be despised.\u201d',
u'Hostage Crisis: \u201cA secret shared is a trust formed.\u201d',
u'Holocron Heist: \u201cA lesson learned is a lesson earned.\u201d',
u'Cargo of Doom: \u201cOverconfidence is the most dangerous form of carelessness.\u201d',
u'Children of the Force: \u201cThe first step to correcting a mistake is patience.\u201d',
u'Senate Spy: \u201cA true heart should never be doubted.\u201d',
u'Landing at Point Rain: \u201cBelieve in yourself or no one else will.\u201d',
u'Weapons Factory: \u201cNo gift is more precious than trust.\u201d',
u'Legacy of Terror: \u201cSometimes, accepting help is harder than offering it.\u201d',
u'Brain Invaders: \u201cAttachment is not compassion\u201d',
u'Grievous Intrigue: \u201cFor everything you gain, you lose something else.\u201d',
u'The Deserter: \u201cIt is the quest for honor that makes one honorable.\u201d',
u'Lightsaber Lost: \u201cEasy isn\u2019t always simple.\u201d',
u'The Mandalore Plot: \u201cIf you ignore the past, you jeopardize your future.\u201d',
u'Voyage of Temptation: \u201cFear not for the future, weep not for the past.\u201d',
u'Duchess of Mandalore: \u201cIn war, truth is the first casualty.\u201d',
u'Senate Murders: \u201cSearching for the truth is easy. Accepting the truth is hard.\u201d',
u'Cat and Mouse: \u201cA wise leader knows when to follow.\u201d',
u'Bounty Hunters: \u201cCourage makes heroes, but trust builds friendship.\u201d',
u'The Zillo Beast: \u201cChoose what is right, not what is easy\u201d',
u'The Zillo Beast Strikes Back: \u201cThe most dangerous beast is the beast within.\u201d',
u'Death Trap: \u201cWho my father was matters less than my memory of him.\u201d',
u'R2 Come Home: \u201cAdversity is friendship\u2019s truest test.\u201d',
u'Lethal Trackdown: \u201cRevenge is a confession of pain.\u201d',
u'Clone Cadets: \u201cBrothers in arms are brothers for life.\u201d',
u'ARC Troopers: \u201cFighting a war tests a soldier\u2019s skills, defending his home tests a soldier\u2019s heart.\u201d',
u'Supply Lines: \u201cWhere there\u2019s a will, there\u2019s a way.\u201d',
u'Sphere of Influence: \u201cA child stolen is a lost hope.\u201d',
u'Corruption: \u201cThe challenge of hope is to overcome corruption.\u201d',
u'The Academy: \u201cThose who enforce the law must obey the law.\u201d',
u'Assassin: \u201cThe future has many paths \u2014 choose wisely.\u201d',
u'Evil Plans: \u201cA failure in planning is a plan for failure.\u201d',
u'Hunt for Ziro: \u201cLove comes in all shapes and sizes.\u201d',
u'Heroes on Both Sides: \u201cFear is a great motivator.\u201d',
u'Pursuit of Peace: \u201cTruth can strike down the specter of fear\u201d',
u'Nightsisters: \u201cThe swiftest path to destruction is through vengeance.\u201d',
u'Monster: \u201cEvil is not born, it is taught.\u201d',
u'Witches of the Mist: \u201cThe path to evil may bring great power, but not loyalty.\u201d',
u'Overlords: \u201cBalance is found in the one who faces his guilt.\u201d',
u'Altar of Mortis: \u201cHe who surrenders hope, surrenders life.\u201d',
u'Ghosts of Mortis: \u201cHe who seeks to control fate shall never find peace.\u201d',
u'The Citadel: \u201cAdaptation is the key to survival.\u201d',
u'Counterattack: \u201cAnything that can go wrong will.\u201d',
u'Citadel Rescue: \u201cWithout honor, victory is hollow.\u201d',
u'Padawan Lost: \u201cWithout humility, courage is a dangerous game.\u201d',
u'Wookiee Hunt: \u201cA great student is what the teacher hopes to be.\u201d',
u'Water wars: \u201cWhen destiny calls, the chosen have no choice.\u201d',
u'Gungan Attack: \u201cOnly through fire is a strong sword forged.\u201d',
u'Prisoners: \u201cCrowns are inherited, kingdoms are earned.\u201d',
u'Shadow Warrior: \u201cWho a person truly is cannot be seen with the eye.\u201d',
u'Mercy Mission: \u201cUnderstanding is honoring the truth beneath the surface.\u201d',
u'Nomad Droids: \u201cWho\u2019s the more foolish, the fool or the fool who follows him?\u201d',
u'Darkness on Umbara: \u201cThe first step toward loyalty is trust.\u201d',
u'The General: \u201cThe path of ignorance is guided by fear.\u201d',
u'Plan of Dissent: \u201cThe wise man leads, the strong man follows.\u201d',
u'Carnage of Krell: Our actions define our legacy.\u201d',
u'Kidnapped: \u201cWhere we are going always reflects where we came from.\u201d',
u'Slaves of the Republic: \u201cThose who enslave others inevitably become slaves themselves.\u201d',
u'Escape from Kadavo: \u201cGreat hope can come from small sacrifices.\u201d',
u'A Friend in Need: \u201cFriendship shows us who we really are.\u201d',
u'Deception: \u201cAll warfare is based on deception.\u201d',
u'Friends and Enemies: \u201cKeep your friends close, but keep your enemies closer.\u201d',
u'The Box: \u201cThe strong survive, the noble overcome.\u201d',
u'Crisis on Naboo: \u201cTrust is the greatest of gifts, but it must be earned.\u201d',
u'Massacre: \u201cOne must let go of the past to hold onto the future.\u201d',
u'Bounty: \u201cWho we are never changes, who we think we are does.\u201d',
u'Brothers: \u201cA fallen enemy may rise again, but the reconciled one is truly vanquished.\u201d',
u'Revenge: \u201cThe enemy of my enemy is my friend.\u201d',
u'Revival: \u201cStrength in character can defeat strength in numbers.\u201d',
u'A War on Two Fronts: \u201cFear is a malleable weapon.\u201d',
u'Front Runners: \u201cTo seek something is to believe in its possibility.\u201d',
u'The Soft War: \u201cStruggles often begin and end with the truth.\u201d',
u'Tipping Points: \u201cDisobedience is a demand for change.\u201d',
u'The Gathering: \u201cHe who faces himself, finds himself.\u201d',
u'A Test of Strength: \u201cThe young are often underestimated.\u201d',
u'Bound for Rescue: \u201cWhen we rescue others, we rescue ourselves.\u201d',
u'A Necessary Bond: \u201cChoose your enemies wisely, as they may be your last hope.\u201d',
u'Secret Weapons: \u201cHumility is the only defense against humiliation.\u201d',
u'A Sunny Day in the Void: \u201cWhen all seems hopeless, a true hero gives hope.\u201d',
u'Missing in Action: \u201cA soldier\u2019s most powerful weapon is courage.\u201d',
u'Point of No Return: \u201cYou must trust in others or success is impossible.\u201d',
u'Eminence: \u201cOne vision can have many interpretations.\u201d',
u'Shades of Reason: \u201cAlliances can stall true intentions.\u201d',
u'The Lawless: \u201cMorality separates heroes from villains.\u201d',
u'Sabotage: \u201cSometimes even the smallest doubt can shake the greatest belief.\u201d',
u'The Jedi who knew too much: \u201cCourage begins by trusting oneself.\u201d',
u'To catch a Jedi: \u201cNever become desperate enough to trust the untrustworthy.\u201d',
u'The Wrong Jedi: Never give up hope, no matter how dark things seem.\u201d']
In [3]:
starwar_quotes_selected_cleaned = []
for quote_number in range(len(starwar_quotes_selected)):
starwar_quotes_selected_cleaned.append(starwar_quotes_selected[quote_number].encode("utf-8").split(":")[1].strip("\xe2\x80\x9d").strip(" \xe2\x80\x9c").replace("\xe2\x80\x99","'").replace("\xe2\x80\x94",","))
starwar_quotes_selected_cleaned
Out[3]:
['Great leaders inspire greatness in others.',
'Belief is not a matter of choice, but conviction.',
'Easy is the path to wisdom for those not blinded by ego.',
'A plan is only as good as those who see it through.',
'The best confidence builder is experience.',
"Trust in your friends, and they'll have reason to trust in you.",
'You hold onto your friends by keeping your heart a little softer than you head.',
'Heroes are made by the times.',
'Ignore your instincts at your peril.',
'Most powerful is he who controls his own power.',
'The winding path to peace is always a worthy one, regardless of how many turns it takes.',
'Fail with honor rather than succeed with fraud.',
'Greed and fear of loss are the roots that lead to the tree of evil.',
'When surrounded by war, one must eventually choose a side.',
'Arrogance diminishes wisdom.',
"Truth enlightens the mind, but won't always bring happiness to your heart.",
'Fear is a disease; hope is its only cure.',
'A single chance is a galaxy of hope.',
'It is a rough road that leads to the heights of greatness.',
'The costs of war can never be truly accounted for.',
'Compromise is a virtue to be cultivated, not a weakness to be despised.',
'A secret shared is a trust formed.',
'A lesson learned is a lesson earned.',
'Overconfidence is the most dangerous form of carelessness.',
'The first step to correcting a mistake is patience.',
'A true heart should never be doubted.',
'Believe in yourself or no one else will.',
'No gift is more precious than trust.',
'Sometimes, accepting help is harder than offering it.',
'Attachment is not compassion',
'For everything you gain, you lose something else.',
'It is the quest for honor that makes one honorable.',
"Easy isn't always simple.",
'If you ignore the past, you jeopardize your future.',
'Fear not for the future, weep not for the past.',
'In war, truth is the first casualty.',
'Searching for the truth is easy. Accepting the truth is hard.',
'A wise leader knows when to follow.',
'Courage makes heroes, but trust builds friendship.',
'Choose what is right, not what is easy',
'The most dangerous beast is the beast within.',
'Who my father was matters less than my memory of him.',
"Adversity is friendship's truest test.",
'Revenge is a confession of pain.',
'Brothers in arms are brothers for life.',
"Fighting a war tests a soldier's skills, defending his home tests a soldier's heart.",
"Where there's a will, there's a way.",
'A child stolen is a lost hope.',
'The challenge of hope is to overcome corruption.',
'Those who enforce the law must obey the law.',
'The future has many paths , choose wisely.',
'A failure in planning is a plan for failure.',
'Love comes in all shapes and sizes.',
'Fear is a great motivator.',
'Truth can strike down the specter of fear',
'The swiftest path to destruction is through vengeance.',
'Evil is not born, it is taught.',
'The path to evil may bring great power, but not loyalty.',
'Balance is found in the one who faces his guilt.',
'He who surrenders hope, surrenders life.',
'He who seeks to control fate shall never find peace.',
'Adaptation is the key to survival.',
'Anything that can go wrong will.',
'Without honor, victory is hollow.',
'Without humility, courage is a dangerous game.',
'A great student is what the teacher hopes to be.',
'When destiny calls, the chosen have no choice.',
'Only through fire is a strong sword forged.',
'Crowns are inherited, kingdoms are earned.',
'Who a person truly is cannot be seen with the eye.',
'Understanding is honoring the truth beneath the surface.',
"Who's the more foolish, the fool or the fool who follows him?",
'The first step toward loyalty is trust.',
'The path of ignorance is guided by fear.',
'The wise man leads, the strong man follows.',
'Our actions define our legacy.',
'Where we are going always reflects where we came from.',
'Those who enslave others inevitably become slaves themselves.',
'Great hope can come from small sacrifices.',
'Friendship shows us who we really are.',
'All warfare is based on deception.',
'Keep your friends close, but keep your enemies closer.',
'The strong survive, the noble overcome.',
'Trust is the greatest of gifts, but it must be earned.',
'One must let go of the past to hold onto the future.',
'Who we are never changes, who we think we are does.',
'A fallen enemy may rise again, but the reconciled one is truly vanquished.',
'The enemy of my enemy is my friend.',
'Strength in character can defeat strength in numbers.',
'Fear is a malleable weapon.',
'To seek something is to believe in its possibility.',
'Struggles often begin and end with the truth.',
'Disobedience is a demand for change.',
'He who faces himself, finds himself.',
'The young are often underestimated.',
'When we rescue others, we rescue ourselves.',
'Choose your enemies wisely, as they may be your last hope.',
'Humility is the only defense against humiliation.',
'When all seems hopeless, a true hero gives hope.',
"A soldier's most powerful weapon is courage.",
'You must trust in others or success is impossible.',
'One vision can have many interpretations.',
'Alliances can stall true intentions.',
'Morality separates heroes from villains.',
'Sometimes even the smallest doubt can shake the greatest belief.',
'Courage begins by trusting oneself.',
'Never become desperate enough to trust the untrustworthy.',
'Never give up hope, no matter how dark things seem.']
In [31]:
path = "./"
with open(path+"starwar_quotes.txt", "wb") as f:
for item in starwar_quotes_selected_cleaned:
f.write("%s\n" % item)
# writer = csv.writer(f)
# writer.writerows([starwar_quotes_selected_cleaned])
In [33]:
pd.read_table(path+"starwar_quotes.txt",header=None)
Out[33]:
0
0
Great leaders inspire greatness in others.
1
Belief is not a matter of choice, but conviction.
2
Easy is the path to wisdom for those not blind...
3
A plan is only as good as those who see it thr...
4
The best confidence builder is experience.
5
Trust in your friends, and they'll have reason...
6
You hold onto your friends by keeping your hea...
7
Heroes are made by the times.
8
Ignore your instincts at your peril.
9
Most powerful is he who controls his own power.
10
The winding path to peace is always a worthy o...
11
Fail with honor rather than succeed with fraud.
12
Greed and fear of loss are the roots that lead...
13
When surrounded by war, one must eventually ch...
14
Arrogance diminishes wisdom.
15
Truth enlightens the mind, but won't always br...
16
Fear is a disease; hope is its only cure.
17
A single chance is a galaxy of hope.
18
It is a rough road that leads to the heights o...
19
The costs of war can never be truly accounted ...
20
Compromise is a virtue to be cultivated, not a...
21
A secret shared is a trust formed.
22
A lesson learned is a lesson earned.
23
Overconfidence is the most dangerous form of c...
24
The first step to correcting a mistake is pati...
25
A true heart should never be doubted.
26
Believe in yourself or no one else will.
27
No gift is more precious than trust.
28
Sometimes, accepting help is harder than offer...
29
Attachment is not compassion
...
...
78
Great hope can come from small sacrifices.
79
Friendship shows us who we really are.
80
All warfare is based on deception.
81
Keep your friends close, but keep your enemies...
82
The strong survive, the noble overcome.
83
Trust is the greatest of gifts, but it must be...
84
One must let go of the past to hold onto the f...
85
Who we are never changes, who we think we are ...
86
A fallen enemy may rise again, but the reconci...
87
The enemy of my enemy is my friend.
88
Strength in character can defeat strength in n...
89
Fear is a malleable weapon.
90
To seek something is to believe in its possibi...
91
Struggles often begin and end with the truth.
92
Disobedience is a demand for change.
93
He who faces himself, finds himself.
94
The young are often underestimated.
95
When we rescue others, we rescue ourselves.
96
Choose your enemies wisely, as they may be you...
97
Humility is the only defense against humiliation.
98
When all seems hopeless, a true hero gives hope.
99
A soldier's most powerful weapon is courage.
100
You must trust in others or success is impossi...
101
One vision can have many interpretations.
102
Alliances can stall true intentions.
103
Morality separates heroes from villains.
104
Sometimes even the smallest doubt can shake th...
105
Courage begins by trusting oneself.
106
Never become desperate enough to trust the unt...
107
Never give up hope, no matter how dark things ...
108 rows × 1 columns
Content source: jealdana/Open-Notebooks
Similar notebooks: