The circle of web scraping

  1. Information identification

  2. Choice of strategy

  3. Data retrieval

  4. Information extraction

  5. Data preparation

  6. Data validation

  7. Debugging and maintenance

  8. Generalization

Retrieval scenarios

library(RCurl)
library(XML)
library(stringr)

Downloading ready-made files

Data in CSV files.

CSV election results data

The Maryland State Board of Elections: http://www.elections.state.md.us/

A set of comma-separated value (CSV) spreadsheets that comprise information on state-, county-, and precint-level election results for the 2012 Presidential election in Maryland

http://www.elections.state.md.us/elections/2012/election_data/index.html

  1. Identify the links to the desired files
?XML::getHTMLLinks
## starting httpd help server ... done
url <- "http://www.elections.state.md.us/elections/2012/election_data/index.html"

page <- readLines(url)

page_parsed <- htmlParse(page)
page_parsed
## <!DOCTYPE html>
## <html lang="en" manifest="manifest.appcache">
## <!-- InstanceBegin template="/Templates/elections.dwt" codeOutsideHTMLIsLocked="false" --><head>
## <meta charset="utf-8">
## <!-- InstanceBeginEditable name="doctitle" --><title>Data Files for the 2012 Presidential Election Results</title>
## <!-- InstanceEndEditable --><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
## <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
## <meta http-equiv="Pragma" content="no-cache">
## <meta http-equiv="Expires" content="0">
## <meta name="keywords" content="Maryland, State, Board of Elections, voting, polling place, campaigns, candidacy, voter registration, election, elections, campaign finance, register, vote, HAVA, petitions, voting system, Maryland State Board of Elections, results, overseas">
## <meta name="author" content="Maryland State Board of Elections">
## <meta name="description" content="The State Board of Elections provides all eligible citizens of the State convenient access to voter registration; provides all registered voters accessible locations in which they may exercise their right to vote, to ensure uniformity of election practices; to promote fair and equitable elections; and to maintain registration records, campaign fund reports, and other election-related data accurately and in a form that is accessible to the public.">
## <!-- Step 1 : Link to MD favicon --><link rel="shortcut icon" href="../../../egov/img/icons/favicon.ico">
## <!-- Necessary Bootstrap.css for responsive design --><link href="../../../egov/frameworks/bootstrap/css/bootstrap.min.css" rel="stylesheet">
## <link href="../../../egov/css/agency-styles.css" rel="stylesheet">
## <link href="../../../egov/css/sbe-agency-styles.css" rel="stylesheet">
## <!--[if ie 8]>
##      <link id="css_IE8" href="../egov/css/ie/ie8.css" rel="stylesheet" media="screen" />
##     <![endif]--><!--[if ie 7]>
##      <link id="css_IE7" href="../egov/css/ie/ie7.css" rel="stylesheet" media="screen" />
##     <![endif]--><!--[if lt IE 9]>
##      <script src="../egov/js/html5shiv.js"></script>
##     <![endif]--><script src="../../../egov/js/jquery-1.8.2.min.js"></script><!--Step 4 : Necessary .js for  Statewide nav bar script --><script type="text/javascript" src="https://yui-s.yahooapis.com/3.1.1/build/yui/yui-min.js"></script><!-- Step 8: Necessary .js and .css for statewide alerts  --><link rel="stylesheet" href="../../../egov/css/jquery-ui-1.10.3.min.css">
## <script src="../../../egov/js/jquery-ui-1.10.3.min.js"></script><script type="text/javascript" src="../../../egov/js/MDAlertCode.js"></script><!-- Google Analytics code --><script type="text/javascript">
## 
##   var _gaq = _gaq || [];
##   _gaq.push(['_setAccount', 'UA-3219333-1']);
##   _gaq.push(['_trackPageview']);
## 
##   (function() {
##     var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
##     ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
##     var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
##   })();
## 
## </script><!-- InstanceBeginEditable name="head" --><style type="text/css"> 
##     
## 
##     
## #select-2012 a {font-weight: bolder; color: #005580;}</style>
## <!-- InstanceEndEditable -->
## </head>
## <body>
##     <div class="container"> 
##         <div class="skipNav">
##             <a href="#primary_content_Block">Skip to Main Content</a>
##         </div>
##         <div id="mdgov_globalSiteWrapper">
##             <div class="row-fluid">
##                 <div id="mdgov_TopSliverBar" class="clearfix">
##                     <div id="mdgov_TopSliverBarContent" class="clearfix">
##                         <div id="mdgov_sliverLeft">
##                             <div id="mdgov_mobileNavButton" class="hidden-desktop">
##                                 <a href="#"><i class="icon-white icon-align-justify">혻</i> <span>Menu</span> </a>
##                             </div>
##                         </div>
##                         <div id="mdgov_sliverRight">
##                         <ul id="mdgov_settingsNav" class="cl_base_hNav">
## <!-- STEP 4: displays statewide nav bar --><script type="text/javascript">
##                              YUI().use(function (Y) {
##                                  var url = "https://www.maryland.gov/branding/statewideNavigationDefer2017.js",
##                                      obj = Y.Get.script(url, {
##                                          onSuccess: function () {
##                                              document.getElementById('mdgov_sliverRight').innerHTML = showStatewideNavigationWithTranslate("white");
##                                          }
##                                      });
##                              });
##                          </script><noscript>You must have Javascript enabled to see this menu.</noscript>
##                                                 
##                           </ul>
## <!-- END statewide nav bar -->
## </div>
##                     </div>
##                 </div>
##             </div>
##             <div id="headerBlock" class="row-fluid">
##                 <div id="header" class="span12">
##                     <div id="headerBackground">
##                         <div class="headerBgImg clearfix">
##                             <div class="row-fluid">
##                                 <div id="agency_branding" class="clearfix">
##                                     <div id="mdgov_crownLogo" class="span2 clearfix">
##                                         <div id="mdgov_homeLink">
##                                         <!-- Step 2 : MD Crown logo and link -->
##                                             <a href="http://www.maryland.gov/">
##                                                 <span class="hidden-accessible">Maryland.gov Home</span>
##                                             </a>
##                                         </div>
##                                     </div>
##                                     <div id="mdgov_agencyName" class="span7 clearfix">
##                                         <div id="mdgov_agencyTitle">
##                                         <!-- Step 3 : Add Agency Title and link to home page -->
##                                             <a href="../../../index.html">
##                                                 <img src="../../../egov/img/sbetitle.png" alt="The Maryland State Board of Elections"></a>
##                                         </div>
##                                     </div>
##                                     <div id="mdgov_agencyHeader" class="span3 clearfix">
##                                         <div id="mdgov_agencyLogo">
##                                          <!-- Step 5: Optional Agency logo and link, replace with agency_logo_blank.png if none -->
##                                             <a href="../../../index.html">
##                                                 <img src="../../../egov/img/SBELogo.png" alt="State Board of Elections Logo"></a>
##                                         </div>
##                                         <div class="mdgov_socialNav clearfix">
##                                         <!-- Step 6: Configure Agency social media icons and links -->
##                                              <ul class="cl_base_hNav cl_socialNav">
## <li>
## <a href="https://www.facebook.com/MarylandStateBoardofElections" class="sm-facebook" title="Facebook">Facebook</a> </li>
##                                             <li>
## <a href="https://twitter.com/md_sbe" class="sm-twitter" title="Twitter">Twitter</a> </li>
##                                             <!--<li><a href="#" class="sm-googleplus" title="Google+">Google Plus</a></li>-->
##                                             
##                                             <li>
## <a href="https://www.maryland.gov/pages/social_media.aspx" class="sm-all" title="MD Social Media Directory">Social Media Directory</a> </li>
##                                             </ul>
## <!--if no agy social media,replace above UL with code below--><!--<ul class="cl_base_hNav cl_socialNavDirectory">
##                                      <li class="last-child"><a href="http://www.maryland.gov/pages/social_media.aspx" class="sm-directory" title="MD Social Media Directory">MD Social Media Directory</a></li>
##                                      </ul>-->
## </div>
##                                     </div>
##                                 </div>
##                             </div>
##                             <div id="mdgov_enterpriseSearch" class="clearfix">
##                                 <div id="mdgov_enterpriseSearchContainer">
##                                     <div id="mdgov_searchInput">
##                                     <!-- Step 7 : statewide search code -->
##                                     
##                                     <form method="GET" action="https://www.maryland.gov/pages/search.aspx">
##         <input type="hidden" name="site" value="tkcl0ycakyo"><input type="hidden" name="name" value="State Board of Elections"><label for="searchInputBox" class="hidden-accessible">Search this Site</label>
##         <input type="text" id="searchInputBox" name="q" class="mdgov_searchInputBox" value="Search this Site" onblur="if(this.value=='')this.value='Search';" onfocus="if(this.value=='Search')this.value='';"><div class="mdgov_searchButton btn btn-primary searchButtonDiv">
##         <input type="image" alt="Search" id="searchButton" src="../../../egov/img/icons/search.png" class="fillImageButton">
## </div>
## </form>
##                                             </div>
##                                      <!-- Step 8: Placeholder for statewide alerts and Agency topics/alerts -->
##                                      <div id="mdgov_trendsAlertsWrapper">
##                                         
##                                     </div>
##                                     
##                                       <div id="agency_trendsAlertsWrapper">
##                                         <div id="agency_trendsAndAlerts" class="hidden-phone hasAlert">
##                                             <div id="agency_alerts">
##                                                 
##                                             </div>
##                                         </div>
##                                     </div>
##                                </div>
## 
##                             </div>
##                         </div>
##                     </div>
##                 </div>
##             </div>
##             <div id="navBlock" class="row-fluid">
##                 <div id="mdgov_enterpriseNavigation" class="clearfix">
##                 <!-- Step 9 : Add Main navigation links -->
##                     <nav><ul>
## <li><a href="../../../index.html" class="level0">Home</a></li>
##                              <li><a href="../../../campaign_finance/index.html" class="level0">Campaign Finance</a></li>
##                          <li><a href="../../../candidacy/index.html" class="level0">Candidacy</a></li>
##                          <li><a href="../../2020/index.html" class="level0">Elections</a></li>                                <li><a href="../../../voter_registration/index.html" class="level0">Voter Registration</a></li>
##                          <li class="last-child"><a href="../../../voting/index.html" class="level0">Voting</a></li>
##                         </ul></nav>
## </div>
##         </div>
##      <!--begin primary content area-->
##          <div class="row-fluid">
##              
##                 <div id="primary_content_Block">
##                 <!--Left Column-->
##                  <div id="primary_left_col" class="span3 leftMargin0">
##                         <div class="mdgov_contentWrapper mdgov_subNav">
##                             <section id="subNav1" class="primary_left_col_list"><!-- Step 14: Quick Nav menu 1 --><header><h2 data-target="subNav1">Elections by Year</h2>                               
##                                 </header><div class="subNavWrapper">
##                                     <ul class="cl_iconNav">
## <li id="select-2020">
## <a href="../../2020/index.html">2020</a>
##       </li>
##                                     <li id="select-2018">
## <a href="../../2018/index.html">2018</a>
##       </li>
##              <li id="select-2016">
## <a href="../../2016/index.html">2016</a>
##       </li>                           <li id="select-2014">
## <a href="../../2014/index.html">2014</a>
##       </li>
##       <li id="select-2012">
## <a href="../index.html">2012</a>
##       </li>
##       <li id="select-2011">
## <a href="../../baltimore/2011.html">2011 - Baltimore City</a>
##       </li>
##     <li id="select-2010">
## <a href="../../2010/index.html">2010</a>
##       </li>
##                                     <li id="select-2008">
## <a href="../../2008/index.html">2008</a>
##       </li>
##             <li id="select-2007">
## <a href="../../baltimore/2007.html">2007 - Baltimore City</a>
##       </li>                       <li id="select-2006">
## <a href="../../2006/index.html">2006</a>
##       </li>
##          <li id="select-2004">
## <a href="../../2004/index.html">2004</a>
##       </li> 
##       <li id="select-2003">
## <a href="../../baltimore/2003.html">2003/2004 - Baltimore City</a> 
##       </li>
##       <li id="select-2002">
## <a href="../../2002/index.html">2002</a>
##       </li> <li id="select-2000">
## <a href="../../2000/index.html">2000</a>
##       </li> 
##       <li id="select-1999">
## <a href="../../baltimore/1999.html">1999 - Baltimore City</a>
##       </li>
##       <li id="select-1998">
## <a href="../../1998/index.html">1998</a>
##       </li>
##        <li id="select-1996">
## <a href="../../1996/index.html">1996</a>
##       </li>
##        <li id="select-1995">
## <a href="../../baltimore/1995.html">1995 - Baltimore City</a>
##       </li>
##        <li id="select-1994">
## <a href="../../1994/index.html">1994</a>
##       </li>
##        <li id="select-1992">
## <a href="../../1992/index.html">1992</a>
##       </li>
##        <li id="select-1991">
## <a href="../../baltimore/1991.html">1991 - Baltimore City</a>
##       </li>
##        <li id="select-1990">
## <a href="../../1990/index.html">1990</a>
##       </li>
##        <li id="select-1988">
## <a href="../../1988/index.html">1988</a>
##       </li>
##        <li id="select-1987">
## <a href="../../baltimore/1987.html">1987 - Baltimore City</a>
##       </li>
##        <li id="select-1986">
## <a href="../../1986/index.html">1986</a>
##       </li>
##             <li id="select-1983">
## <a href="../../baltimore/1983.html">1983 - Baltimore City</a>
##       </li>
##                                     </ul>
## </div>
##                          </section><section id="subNav2" class="primary_left_col_list"><header><h2 data-target="subNav2">Other Election Information</h2>
##         </header><div class="subNavWrapper">
##             <ul class="cl_iconNav">
## <li id="special"> 
##                                         <a href="../../special_elections.html">Special Elections</a>
##                                     </li>
##                                     <li id="districts">
##                                         <a href="../../districts.html">Districts</a>
##                                     </li>
##                                     <li id="elect_college">
## <a href="../../electoral_college.html">Electoral College</a>
##                                      </li>
##                                     <li id="pres_results">
##                                         <a href="../../presidential.html">Presidential Candidate Results in MD from 1948 to Present</a>
##               </li>
## </ul>
## </div>
##     </section>
## </div>
##                      </div>
##                      <div id="primary_right_col" class="span9">
##         <div class="mdgov_contentWrapper">
##                  <!-- InstanceBeginEditable name="PrimaryRowContent" -->
##                     <h1>Data Files for the 2012 Presidential Election Results</h1>
##                     <p>Links on this page point to files containing raw election results. For more information regarding these files please see the <a href="../../using_election_data_instructions.html">using election data instructions</a>.</p>
##      <h3>Precinct References</h3>
##      <p><a href="state_precinct_reference_2012_general.xls">State Precinct Reference for the 2012 General Election (Excel)</a></p>
## <p><a href="state_precinct_reference_2012_primary.xls">State Precinct Reference for the 2012 Primary Election (Excel)</a></p>
##          <div class="device_overflow">This table may scroll left to right depending on the screen size of your device.</div>
## <div class="mdgov_OverflowTable">
##     <table class="ui-table table-stripe" border="1" cellpadding="4" cellspacing="1" width="92%">
## <caption align="left">Statewide Data</caption>
##              <tr>
## <th width="165" scope="col">Breakdown by</th>
##                  <th width="120" scope="col">Primary</th>
##                  <th width="120" scope="col">General</th>
##                  <th width="156" scope="col">Ballot Questions</th>
##              </tr>
## <tr>
## <td height="73">State Congressional Districts</td>
##                <td>
## <a href="State_Congressional_Districts_Democratic_2012_Primary.csv">Democrat</a><br><a href="State_Congressional_Districts_Republican_2012_Primary.csv">Republican</a><br><a href="State_Congressional_Districts_NonPartisan_2012_Primary.csv">Non-Partisan</a>
## </td>
##                <td><a href="State_Congressional_Districts_2012_General.csv">General</a></td>
##                <td><a href="Questions_State_Congressional_Districts_2012.csv">Ballot Questions</a></td>
##            </tr>
## <tr>
## <td>State Legislative Districts</td>
##                  <td>
## <a href="State_Legislative_Districts_Democratic_2012_Primary.csv">Democrat</a><br><a href="State_Legislative_Districts_Republican_2012_Primary.csv">Republican</a><br><a href="State_Legislative_Districts_NonPartisan_2012_Primary.csv">Non-Partisan</a> </td>
##                  <td>
##                      <a href="State_Legislative_Districts_2012_General.csv">General</a>
##                  </td>
##                  <td>
##                      <a href="Questions_State_Legislative_Districts_2012.csv">Ballot Questions</a>
##                  </td>
##              </tr>
## <tr>
## <td>Precinct Results</td>
##                  <td>
## <a href="All_By_Precinct_Democratic_2012_Primary.csv">Democrat</a><br><a href="All_By_Precinct_Republican_2012_Primary.csv">Republican</a><br><a href="All_By_Precinct_NonPartisan_2012_Primary.csv">Non-Partisan</a>
## </td>
##                  <td>
##                      <a href="All_By_Precinct_2012_General.csv">General</a>
##                  </td>
##                  <td>
##                      <a href="ALL_Questions_Precinct_2012.csv">Ballot Questions</a>
##                  </td>
##              </tr>
## </table>
## </div>
## <br><div class="device_overflow">This table may scroll left to right depending on the screen size of your device.</div>
## <div class="mdgov_OverflowTable">
##     <table class="ui-table table-stripe" width="92%" border="1" cellpadding="4" cellspacing="1">
## <caption align="left">Allegany County Data</caption>
##              <tr>
## <th width="29%" scope="col">Breakdown by</th>
##                  <th width="23%" scope="col">Primary</th>
##                  <th width="20%" scope="col">General</th>
##                  <th width="28%" scope="col">Ballot Questions</th>
##              </tr>
## <tr>
## <td>County Results</td>
##                  <td>
## <a href="Allegany_County_Democratic_2012_Primary.csv">Democrat</a><br><a href="Allegany_County_Republican_2012_Primary.csv">Republican</a><br><a href="Allegany_County_NonPartisan_2012_Primary.csv">Non-Partisan</a> </td>
##                  <td>
##                      <a href="Allegany_County_2012_General.csv">General</a>                  </td>
##                  <td>
##                      <a href="Allegany_Questions_County_2012.csv">Ballot Questions</a>                   </td>
##              </tr>
## <tr>
## <td>Precinct Results</td>
##                  <td>
## <a href="Allegany_By_Precinct_Democratic_2012_Primary.csv">Democrat</a><br><a href="Allegany_By_Precinct_Republican_2012_Primary.csv">Republican</a><br><a href="Allegany_By_Precinct_NonPartisan_2012_Primary.csv">Non-Partisan</a> </td>
##                  <td>
##                      <a href="Allegany_By_Precinct_2012_General.csv">General</a>                 </td>
##                  <td>
##                      <a href="Allegany_Questions_Precinct_2012.csv">Ballot Questions</a>                 </td>
##              </tr>
## </table>
## </div>
##          <br><div class="device_overflow">This table may scroll left to right depending on the screen size of your device.</div>
## <div class="mdgov_OverflowTable">
##     <table class="ui-table table-stripe" width="92%" border="1" cellpadding="4" cellspacing="1">
## <caption align="left">Anne Arundel County Data</caption>
##              <tr>
## <th width="28%" scope="col">Breakdown by</th>
##                  <th width="21%" scope="col">Primary</th>
##                  <th width="17%" scope="col">General</th>
##                  <th width="34%" scope="col">Ballot Questions</th>
##              </tr>
## <tr>
## <td>County Results</td>
##                  <td>
## <a href="Anne_Arundel_County_Democratic_2012_Primary.csv">Democrat</a><br><a href="Anne_Arundel_County_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Anne_Arundel_County_2012_General.csv">General</a>                  </td>
##                  <td>
##                      <a href="Anne_Arundel_Questions_County_2012.csv">Ballot Questions</a>                   </td>
##              </tr>
## <tr>
## <td>Precinct Results</td>
##                  <td>
## <a href="Anne_Arundel_By_Precinct_Democratic_2012_Primary.csv">Democrat</a><br><a href="Anne_Arundel_By_Precinct_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Anne_Arundel_By_Precinct_2012_General.csv">General</a>                 </td>
##                  <td>
##                      <a href="Anne_Arundel_Questions_Precinct_2012.csv">Ballot Questions</a>                 </td>
##              </tr>
## <tr>
## <td>Councilmanic and<br> Commissioner<br> Districts</td>
##                  <td>
## <a href="Anne_Arundel_Local_Legislative_Districts_Democratic_2012_Primary.csv">Democrat</a><br><a href="Anne_Arundel_Local_Legislative_Districts_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Anne_Arundel_Local_Legislative_Districts_2012_General.csv">General</a>                 </td>
##                  <td>
##                      <a href="Anne_Arundel_Questions_Local_Legislative_Districts_2012.csv">Ballot Questions</a>                  </td>
##              </tr>
## </table>
## </div>
##              <br><div class="device_overflow">This table may scroll left to right depending on the screen size of your device.</div>
## <div class="mdgov_OverflowTable">
##     <table class="ui-table table-stripe" width="92%" border="1" cellpadding="4" cellspacing="1">
## <caption align="left">Baltimore City Data</caption>
## <tr>
## <th width="27%" scope="col">Breakdown by</th>
##                  <th width="22%" scope="col">Primary</th>
##                  <th width="17%" scope="col">General</th>
##                  <th width="34%" scope="col">Ballot Questions</th>
##              </tr>
## <tr>
## <td>County Results</td>
##                  <td>
## <a href="Baltimore_City_County_Democratic_2012_Primary.csv">Democrat</a><br><a href="Baltimore_City_County_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Baltimore_City_County_2012_General.csv">General</a>                    </td>
##                  <td>
##                      <a href="Baltimore_City_Questions_County_2012.csv">Ballot Questions</a>                 </td>
##              </tr>
## <tr>
## <td>Precinct Results</td>
##                  <td>
## <a href="Baltimore_City_By_Precinct_Democratic_2012_Primary.csv">Democrat</a><br><a href="Baltimore_City_By_Precinct_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Baltimore_City_By_Precinct_2012_General.csv">General</a>                   </td>
##                  <td>
##                      <a href="Baltimore_City_Questions_Precinct_2012.csv">Ballot Questions</a>                   </td>
##              </tr>
## <tr>
## <td>Councilmanic and<br> Commissioner<br> Districts</td>
##                  <td>
## <a href="Baltimore_City_Local_Legislative_Districts_Democratic_2012_Primary.csv">Democrat</a><br><a href="Baltimore_City_Local_Legislative_Districts_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Baltimore_City_Local_Legislative_Districts_2012_General.csv">General</a>                   </td>
##                  <td>
##                      <a href="Baltimore_City_Questions_Local_Legislative_Districts_2012.csv">Ballot Questions</a>                    </td>
##              </tr>
## </table>
## </div>
##          <br><div class="device_overflow">This table may scroll left to right depending on the screen size of your device.</div>
## <div class="mdgov_OverflowTable">
##     <table class="ui-table table-stripe" width="92%" border="1" cellpadding="4" cellspacing="1">
## <caption align="left">Baltimore County Data</caption>
## <tr>
## <th width="27%" scope="col">Breakdown by</th>
##                  <th width="22%" scope="col">Primary</th>
##                  <th width="17%" scope="col">General</th>
##                  <th width="34%" scope="col">Ballot Questions</th>
##              </tr>
## <tr>
## <td>County Results</td>
##                  <td>
## <a href="Baltimore_County_Democratic_2012_Primary.csv">Democrat</a><br><a href="Baltimore_County_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Baltimore_County_2012_General.csv">General</a>                 </td>
##                  <td>
##                      <a href="Baltimore_Questions_County_2012.csv">Ballot Questions</a>                  </td>
##              </tr>
## <tr>
## <td>Precinct Results</td>
##                  <td>
## <a href="Baltimore_By_Precinct_Democratic_2012_Primary.csv">Democrat</a><br><a href="Baltimore_By_Precinct_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Baltimore_By_Precinct_2012_General.csv">General</a>                    </td>
##                  <td>
##                      <a href="Baltimore_Questions_Precinct_2012.csv">Ballot Questions</a>                    </td>
##              </tr>
## <tr>
## <td>Councilmanic and<br> Commissioner<br> Districts</td>
##                  <td>
## <a href="Baltimore_Local_Legislative_Districts_Democratic_2012_Primary.csv">Democrat</a><br><a href="Baltimore_Local_Legislative_Districts_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Baltimore_Local_Legislative_Districts_2012_General.csv">General</a>                    </td>
##                  <td>
##                      <a href="Baltimore_Questions_Local_Legislative_Districts_2012.csv">Ballot Questions</a>                 </td>
## 
##              </tr>
## </table>
## </div>
##          <br><div class="device_overflow">This table may scroll left to right depending on the screen size of your device.</div>
## <div class="mdgov_OverflowTable">
##     <table class="ui-table table-stripe" width="92%" border="1" cellpadding="4" cellspacing="1">
## <caption align="left">Calvert County Data</caption>
## <tr>
## <th scope="col">Breakdown by</th>
##                  <th scope="col">Primary</th>
##                  <th scope="col">General</th>
##                  <th scope="col">Ballot Questions</th>
##              </tr>
## <tr>
## <td>County Results</td>
##                  <td>
## <a href="Calvert_County_Democratic_2012_Primary.csv">Democrat</a><br><a href="Calvert_County_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Calvert_County_2012_General.csv">General</a>                   </td>
##                  <td>
##                      <a href="Calvert_Questions_County_2012.csv">Ballot Questions</a>                    </td>
##              </tr>
## <tr>
## <td>Precinct Results</td>
##                  <td>
## <a href="Calvert_By_Precinct_Democratic_2012_Primary.csv">Democrat</a><br><a href="Calvert_By_Precinct_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Calvert_By_Precinct_2012_General.csv">General</a>                  </td>
##                  <td>
##                      <a href="Calvert_Questions_Precinct_2012.csv">Ballot Questions</a>                  </td>
##              </tr>
## <tr>
## <td>Councilmanic and<br> Commissioner<br> Districts</td>
##                  <td>
## <a href="Calvert_Local_Legislative_Districts_Democratic_2012_Primary.csv">Democrat</a><br><a href="Calvert_Local_Legislative_Districts_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Calvert_Local_Legislative_Districts_2012_General.csv">General</a>                  </td>
##                  <td>
##                      <a href="Calvert_Questions_Local_Legislative_Districts_2012.csv">Ballot Questions</a>                   </td>
##              </tr>
## </table>
## </div>
##          <br><div class="device_overflow">This table may scroll left to right depending on the screen size of your device.</div>
## <div class="mdgov_OverflowTable">
##     <table class="ui-table table-stripe" width="92%" border="1" cellpadding="4" cellspacing="1">
## <caption align="left">Caroline County Data</caption>
## <tr>
## <th scope="col">Breakdown by</th>
##                  <th scope="col">Primary</th>
##                  <th scope="col">General</th>
##                  <th scope="col">Ballot Questions</th>
##              </tr>
## <tr>
## <td>County Results</td>
##                  <td>
## <a href="Caroline_County_Democratic_2012_Primary.csv">Democrat</a><br><a href="Caroline_County_Republican_2012_Primary.csv">Republican</a><br><a href="Caroline_County_NonPartisan_2012_Primary.csv">Non-Partisan</a> </td>
##                  <td>
##                      <a href="Caroline_County_2012_General.csv">General</a>                  </td>
##                  <td>
##                      <a href="Caroline_Questions_County_2012.csv">Ballot Questions</a>                   </td>
##              </tr>
## <tr>
## <td>Precinct Results</td>
##                  <td>
## <a href="Caroline_By_Precinct_Democratic_2012_Primary.csv">Democrat</a><br><a href="Caroline_By_Precinct_Republican_2012_Primary.csv">Republican</a><br><a href="Caroline_By_Precinct_NonPartisan_2012_Primary.csv">Non-Partisan</a> </td>
##                  <td>
##                      <a href="Caroline_By_Precinct_2012_General.csv">General</a>                 </td>
##                  <td>
##                      <a href="Caroline_Questions_Precinct_2012.csv">Ballot Questions</a>                 </td>
##              </tr>
## </table>
## </div>
##          <br><div class="device_overflow">This table may scroll left to right depending on the screen size of your device.</div>
## <div class="mdgov_OverflowTable">
##     <table class="ui-table table-stripe" width="92%" border="1" cellpadding="4" cellspacing="1">
## <caption align="left">Carroll County Data</caption>
## <tr>
## <th scope="col">Breakdown by</th>
##                  <th scope="col">Primary</th>
##                  <th scope="col">General</th>
##                  <th scope="col">Ballot Questions</th>
##              </tr>
## <tr>
## <td>County Results</td>
##                  <td>
## <a href="Carroll_County_Democratic_2012_Primary.csv">Democrat</a><br><a href="Carroll_County_Republican_2012_Primary.csv">Republican</a><br><a href="Carroll_County_NonPartisan_2012_Primary.csv">Non-Partisan</a> </td>
##                  <td>
##                      <a href="Carroll_County_2012_General.csv">General</a>                   </td>
##                  <td>
##                      <a href="Carroll_Questions_County_2012.csv">Ballot Questions</a>                    </td>
##              </tr>
## <tr>
## <td>Precinct Results</td>
##                  <td>
## <a href="Carroll_By_Precinct_Democratic_2012_Primary.csv">Democrat</a><br><a href="Carroll_By_Precinct_Republican_2012_Primary.csv">Republican</a><br><a href="Carroll_By_Precinct_NonPartisan_2012_Primary.csv">Non-Partisan</a> </td>
##                  <td>
##                      <a href="Carroll_By_Precinct_2012_General.csv">General</a>                  </td>
##                  <td>
##                      <a href="Carroll_Questions_Precinct_2012.csv">Ballot Questions</a>                  </td>
##              </tr>
## <tr>
## <td>Councilmanic and<br> Commissioner<br> Districts</td>
##                  <td>
## <a href="Carroll_Local_Legislative_Districts_Democratic_2012_Primary.csv">Democrat</a><br><a href="Carroll_Local_Legislative_Districts_Republican_2012_Primary.csv">Republican</a><br><a href="Carroll_Local_Legislative_Districts_NonPartisan_2012_Primary.csv">Non-Partisan</a> </td>
##                  <td>
##                      <a href="Carroll_Local_Legislative_Districts_2012_General.csv">General</a>                  </td>
##                  <td>
##                      <a href="Carroll_Questions_Local_Legislative_Districts_2012.csv">Ballot Questions</a>                   </td>
##              </tr>
## </table>
## </div>
##          <br><div class="device_overflow">This table may scroll left to right depending on the screen size of your device.</div>
## <div class="mdgov_OverflowTable">
##     <table class="ui-table table-stripe" width="92%" border="1" cellpadding="4" cellspacing="1">
## <caption align="left">Cecil County Data</caption>
## <tr>
## <th scope="col">Breakdown by</th>
##                  <th scope="col">Primary</th>
##                  <th scope="col">General</th>
##                  <th scope="col">Ballot Questions</th>
##              </tr>
## <tr>
## <td>County Results</td>
##                  <td>
## <a href="Cecil_County_Democratic_2012_Primary.csv">Democrat</a><br><a href="Cecil_County_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Cecil_County_2012_General.csv">General</a>                 </td>
##                  <td>
##                      <a href="Cecil_Questions_County_2012.csv">Ballot Questions</a>                  </td>
##              </tr>
## <tr>
## <td>Precinct Results</td>
##                  <td>
## <a href="Cecil_By_Precinct_Democratic_2012_Primary.csv">Democrat</a><br><a href="Cecil_By_Precinct_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Cecil_By_Precinct_2012_General.csv">General</a>                    </td>
##                  <td>
##                      <a href="Cecil_Questions_Precinct_2012.csv">Ballot Questions</a>                    </td>
##              </tr>
## <tr>
## <td>Councilmanic and<br> Commissioner<br> Districts</td>
##                  <td>
## <a href="Cecil_Local_Legislative_Districts_Democratic_2012_Primary.csv">Democrat</a><br><a href="Cecil_Local_Legislative_Districts_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Cecil_Local_Legislative_Districts_2012_General.csv">General</a>                    </td>
##                  <td>
##                      <a href="Cecil_Questions_Local_Legislative_Districts_2012.csv">Ballot Questions</a>                 </td>
##              </tr>
## </table>
## </div>
##          <br><div class="device_overflow">This table may scroll left to right depending on the screen size of your device.</div>
## <div class="mdgov_OverflowTable">
##     <table class="ui-table table-stripe" width="92%" border="1" cellpadding="4" cellspacing="1">
## <caption align="left">Charles County Data</caption>
## <tr>
## <th scope="col">Breakdown by</th>
##                  <th scope="col">Primary</th>
##                  <th scope="col">General</th>
##                  <th scope="col">Ballot Questions</th>
##              </tr>
## <tr>
## <td>County Results</td>
##                  <td>
## <a href="Charles_County_Democratic_2012_Primary.csv">Democrat</a><br><a href="Charles_County_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Charles_County_2012_General.csv">General</a>                   </td>
##                  <td>
##                      <a href="Charles_Questions_County_2012.csv">Ballot Questions</a>                    </td>
##              </tr>
## <tr>
## <td>Precinct Results</td>
##                  <td>
## <a href="Charles_By_Precinct_Democratic_2012_Primary.csv">Democrat</a><br><a href="Charles_By_Precinct_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Charles_By_Precinct_2012_General.csv">General</a>                  </td>
##                  <td>
##                      <a href="Charles_Questions_Precinct_2012.csv">Ballot Questions</a>                  </td>
##              </tr>
## <tr>
## <td>Councilmanic and<br> Commissioner<br> Districts</td>
##                  <td>
## <a href="Charles_Local_Legislative_Districts_Democratic_2012_Primary.csv">Democrat</a><br><a href="Charles_Local_Legislative_Districts_Republican_2012_Primary.csv">Republican</a><br>
## </td>
##                  <td>
##                      <a href="Charles_Local_Legislative_Districts_2012_General.csv">General</a>                  </td>
##                  <td>
##                      <a href="Charles_Questions_Local_Legislative_Districts_2012.csv">Ballot Questions</a>                   </td>
##              </tr>
## </table>
## </div>
##          <br><div class="device_overflow">This table may scroll left to right depending on the screen size of your device.</div>
## <div class="mdgov_OverflowTable">
##     <table class="ui-table table-stripe" width="92%" border="1" cellpadding="4" cellspacing="1">
## <caption align="left">Dorchester County Data</caption>
## <tr>
## <th scope="col">Breakdown by</th>
##                  <th scope="col">Primary</th>
##                  <th scope="col">General</th>
##                  <th scope="col">Ballot Questions</th>
##              </tr>
## <tr>
## <td>County Results</td>
##                  <td>
## <a href="Dorchester_County_Democratic_2012_Primary.csv">Democrat</a><br><a href="Dorchester_County_Republican_2012_Primary.csv">Republican</a><br><a href="Dorchester_County_NonPartisan_2012_Primary.csv">Non-Partisan</a> </td>
##                  <td>
##                      <a href="Dorchester_County_2012_General.csv">General</a>                    </td>
##                  <td>
##                      <a href="Dorchester_Questions_County_2012.csv">Ballot Questions</a>                 </td>
##              </tr>
## <tr>
## <td>Precinct Results</td>
##                  <td>
## <a href="Dorchester_By_Precinct_Democratic_2012_Primary.csv">Democrat</a><br><a href="Dorchester_By_Precinct_Republican_2012_Primary.csv">Republican</a><br><a href="Dorchester_By_Precinct_NonPartisan_2012_Primary.csv">Non-Partisan</a> </td>
##                  <td>
##                      <a href="Dorchester_By_Precinct_2012_General.csv">General</a>                   </td>
##                  <td>
##                      <a href="Dorchester_Questions_Precinct_2012.csv">Ballot Questions</a>                   </td>
##              </tr>
## <tr>
## <td>Councilmanic and<br> Commissioner<br> Districts</td>
##                  <td>
## <a href="Dorchester_Local_Legislative_Districts_Democratic_2012_Primary.csv">Democrat</a><br><a href="Dorchester_Local_Legislative_Districts_Republican_2012_Primary.csv">Republican</a><br><a href="Dorchester_Local_Legislative_Districts_NonPartisan_2012_Primary.csv">Non-Partisan</a> </td>
##                  <td>
##                      <a href="Dorchester_Local_Legislative_Districts_2012_General.csv">General</a>                   </td>
##                  <td>
##                      <a href="Dorchester_Questions_Local_Legislative_Districts_2012.csv">Ballot Questions</a>                    </td>
##              </tr>
## </table>
## </div>
##          <br><div class="device_overflow">This table may scroll left to right depending on the screen size of your device.</div>
## <div class="mdgov_OverflowTable">
##     <table class="ui-table table-stripe" width="92%" border="1" cellpadding="4" cellspacing="1">
## <caption align="left">Frederick County Data</caption>
## <tr>
## <th scope="col">Breakdown by</th>
##                  <th scope="col">Primary</th>
##                  <th scope="col">General</th>
##                  <th scope="col">Ballot Questions</th>
##              </tr>
## <tr>
## <td>County Results</td>
##                  <td>
## <a href="Frederick_County_Democratic_2012_Primary.csv">Democrat</a><br><a href="Frederick_County_Republican_2012_Primary.csv">Republican</a><br><a href="Frederick_County_NonPartisan_2012_Primary.csv">Non-Partisan</a> </td>
##                  <td>
##                      <a href="Frederick_County_2012_General.csv">General</a>                 </td>
##                  <td>
##                      <a href="Frederick_Questions_County_2012.csv">Ballot Questions</a>                  </td>
##              </tr>
## <tr>
## <td>Precinct Results</td>
##                  <td>
## <a href="Frederick_By_Precinct_Democratic_2012_Primary.csv">Democrat</a><br><a href="Frederick_By_Precinct_Republican_2012_Primary.csv">Republican</a><br><a href="Frederick_By_Precinct_NonPartisan_2012_Primary.csv">Non-Partisan</a>
## </td>
##                  <td>
##                      <a href="Frederick_By_Precinct_2012_General.csv">General</a>                    </td>
##                  <td>
##                      <a href="Frederick_Questions_Precinct_2012.csv">Ballot Questions</a>                    </td>
##              </tr>
## </table>
## </div>
##          <br><div class="device_overflow">This table may scroll left to right depending on the screen size of your device.</div>
## <div class="mdgov_OverflowTable">
##     <table class="ui-table table-stripe" width="92%" border="1" cellpadding="4" cellspacing="1">
## <caption align="left">Garrett County Data</caption>
## <tr>
## <th scope="col">Breakdown by</th>
##                  <th scope="col">Primary</th>
##                  <th scope="col">General</th>
##                  <th scope="col">Ballot Questions</th>
##              </tr>
## <tr>
## <td>County Results</td>
##                  <td>
## <a href="Garrett_County_Democratic_2012_Primary.csv">Democrat</a><br><a href="Garrett_County_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Garrett_County_2012_General.csv">General</a>                   </td>
##                  <td>
##                      <a href="Garrett_Questions_County_2012.csv">Ballot Questions</a>                    </td>
##              </tr>
## <tr>
## <td>Precinct Results</td>
##                  <td>
## <a href="Garrett_By_Precinct_Democratic_2012_Primary.csv">Democrat</a><br><a href="Garrett_By_Precinct_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Garrett_By_Precinct_2012_General.csv">General</a>                  </td>
##                  <td>
##                      <a href="Garrett_Questions_Precinct_2012.csv">Ballot Questions</a>                  </td>
##              </tr>
## <tr>
## <td>Councilmanic and<br> Commissioner<br> Districts</td>
##                  <td>
## <a href="Garrett_Local_Legislative_Districts_Democratic_2012_Primary.csv">Democrat</a><br><a href="Garrett_Local_Legislative_Districts_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Garrett_Local_Legislative_Districts_2012_General.csv">General</a>                  </td>
##                  <td>
##                      <a href="Garrett_Questions_Local_Legislative_Districts_2012.csv">Ballot Questions</a>                   </td>
##              </tr>
## </table>
## </div>
##          <br><div class="device_overflow">This table may scroll left to right depending on the screen size of your device.</div>
## <div class="mdgov_OverflowTable">
##     <table class="ui-table table-stripe" width="92%" border="1" cellpadding="4" cellspacing="1">
## <caption align="left">Harford County Data</caption>
## <tr>
## <th scope="col">Breakdown by</th>
##                  <th scope="col">Primary</th>
##                  <th scope="col">General</th>
##                  <th scope="col">Ballot Questions</th>
##              </tr>
## <tr>
## <td>County Results</td>
##                  <td>
## <a href="Harford_County_Democratic_2012_Primary.csv">Democrat</a><br><a href="Harford_County_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Harford_County_2012_General.csv">General</a>                   </td>
##                  <td>
##                      <a href="Harford_Questions_County_2012.csv">Ballot Questions</a>                    </td>
##              </tr>
## <tr>
## <td>Precinct Results</td>
##                  <td>
## <a href="Harford_By_Precinct_Democratic_2012_Primary.csv">Democrat</a><br><a href="Harford_By_Precinct_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Harford_By_Precinct_2012_General.csv">General</a>                  </td>
##                  <td>
##                      <a href="Harford_Questions_Precinct_2012.csv">Ballot Questions</a>                  </td>
##              </tr>
## <tr>
## <td>Councilmanic and<br> Commissioner<br> Districts</td>
##                  <td>
## <a href="Harford_Local_Legislative_Districts_Democratic_2012_Primary.csv">Democrat</a><br><a href="Harford_Local_Legislative_Districts_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Harford_Local_Legislative_Districts_2012_General.csv">General</a>                  </td>
##                  <td>
##                      <a href="Harford_Questions_Local_Legislative_Districts_2012.csv">Ballot Questions</a>                   </td>
##              </tr>
## </table>
## </div>
##          <br><div class="device_overflow">This table may scroll left to right depending on the screen size of your device.</div>
## <div class="mdgov_OverflowTable">
##     <table class="ui-table table-stripe" width="92%" border="1" cellpadding="4" cellspacing="1">
## <caption align="left">Howard County Data</caption>
## <tr>
## <th scope="col">Breakdown by</th>
##                  <th scope="col">Primary</th>
##                  <th scope="col">General</th>
##                  <th scope="col">Ballot Questions</th>
##              </tr>
## <tr>
## <td>County Results</td>
##                  <td>
## <a href="Howard_County_Democratic_2012_Primary.csv">Democrat</a><br><a href="Howard_County_Republican_2012_Primary.csv">Republican</a><br><a href="Howard_County_NonPartisan_2012_Primary.csv">Non-Partisan</a> </td>
##                  <td>
##                      <a href="Howard_County_2012_General.csv">General</a>                    </td>
##                  <td>
##                      <a href="Howard_Questions_County_2012.csv">Ballot Questions</a>                 </td>
##              </tr>
## <tr>
## <td>Precinct Results</td>
##                  <td>
## <a href="Howard_By_Precinct_Democratic_2012_Primary.csv">Democrat</a><br><a href="Howard_By_Precinct_Republican_2012_Primary.csv">Republican</a><br><a href="Howard_By_Precinct_NonPartisan_2012_Primary.csv">Non-Partisan</a>
## </td>
##                  <td>
##                      <a href="Howard_By_Precinct_2012_General.csv">General</a>                   </td>
##                  <td>
##                      <a href="Howard_Questions_Precinct_2012.csv">Ballot Questions</a>                   </td>
##              </tr>
## <tr>
## <td>Councilmanic and<br> Commissioner<br> Districts</td>
##                  <td>
## <a href="Howard_Local_Legislative_Districts_Democratic_2012_Primary.csv">Democrat</a><br><a href="Howard_Local_Legislative_Districts_Republican_2012_Primary.csv">Republican</a><br><a href="Howard_Local_Legislative_Districts_NonPartisan_2012_Primary.csv">Non-Partisan</a> </td>
##                  <td>
##                      <a href="Howard_Local_Legislative_Districts_2012_General.csv">General</a>                   </td>
##                  <td>
##                      <a href="Howard_Questions_Local_Legislative_Districts_2012.csv">Ballot Questions</a>                    </td>
##              </tr>
## </table>
## </div>
##          <br><div class="device_overflow">This table may scroll left to right depending on the screen size of your device.</div>
## <div class="mdgov_OverflowTable">
##     <table class="ui-table table-stripe" width="92%" border="1" cellpadding="4" cellspacing="1">
## <caption align="left">Kent County Data</caption>
## <tr>
## <th scope="col">Breakdown by</th>
##                  <th scope="col">Primary</th>
##                  <th scope="col">General</th>
##                  <th scope="col">Ballot Questions</th>
##              </tr>
## <tr>
## <td>County Results</td>
##                  <td>
## <a href="Kent_County_Democratic_2012_Primary.csv">Democrat</a><br><a href="Kent_County_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Kent_County_2012_General.csv">General</a>                  </td>
##                  <td>
##                      <a href="Kent_Questions_County_2012.csv">Ballot Questions</a>                   </td>
##              </tr>
## <tr>
## <td>Precinct Results</td>
##                  <td>
## <a href="Kent_By_Precinct_Democratic_2012_Primary.csv">Democrat</a><br><a href="Kent_By_Precinct_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Kent_By_Precinct_2012_General.csv">General</a>                 </td>
##                  <td>
##                      <a href="Kent_Questions_Precinct_2012.csv">Ballot Questions</a>                 </td>
##              </tr>
## </table>
## </div>
##          <br><div class="device_overflow">This table may scroll left to right depending on the screen size of your device.</div>
## <div class="mdgov_OverflowTable">
##     <table class="ui-table table-stripe" width="92%" border="1" cellpadding="4" cellspacing="1">
## <caption align="left">Montgomery County Data</caption>
## <tr>
## <th scope="col">Breakdown by</th>
##                  <th scope="col">Primary</th>
##                  <th scope="col">General</th>
##                  <th scope="col">Ballot Questions</th>
##              </tr>
## <tr>
## <td>County Results</td>
##                  <td>
## <a href="Montgomery_County_Democratic_2012_Primary.csv">Democrat</a><br><a href="Montgomery_County_Republican_2012_Primary.csv">Republican</a><br><a href="Montgomery_County_NonPartisan_2012_Primary.csv">Non-Partisan</a> </td>
##                  <td>
##                      <a href="Montgomery_County_2012_General.csv">General</a>                    </td>
##                  <td>
##                      <a href="Montgomery_Questions_County_2012.csv">Ballot Questions</a>                 </td>
##              </tr>
## <tr>
## <td>Precinct Results</td>
##                  <td>
## <a href="Montgomery_By_Precinct_Democratic_2012_Primary.csv">Democrat</a><br><a href="Montgomery_By_Precinct_Republican_2012_Primary.csv">Republican</a><br><a href="Montgomery_By_Precinct_NonPartisan_2012_Primary.csv">Non-Partisan</a> </td>
##                  <td>
##                      <a href="Montgomery_By_Precinct_2012_General.csv">General</a>                   </td>
##                  <td>
##                      <a href="Montgomery_Questions_Precinct_2012.csv">Ballot Questions</a>                   </td>
##              </tr>
## <tr>
## <td>Councilmanic and<br> Commissioner<br> Districts</td>
##                  <td>
## <a href="Montgomery_Local_Legislative_Districts_Democratic_2012_Primary.csv">Democrat</a><br><a href="Montgomery_Local_Legislative_Districts_Republican_2012_Primary.csv">Republican</a><br><a href="Montgomery_Local_Legislative_Districts_NonPartisan_2012_Primary.csv">Non-Partisan</a>
## </td>
##                  <td>
##                      <a href="Montgomery_Local_Legislative_Districts_2012_General.csv">General</a>                   </td>
##                  <td>
##                      <a href="Montgomery_Questions_Local_Legislative_Districts_2012.csv">Ballot Questions</a>                    </td>
##              </tr>
## </table>
## </div>
##          <br><div class="device_overflow">This table may scroll left to right depending on the screen size of your device.</div>
## <div class="mdgov_OverflowTable">
##     <table class="ui-table table-stripe" width="92%" border="1" cellpadding="4" cellspacing="1">
## <caption align="left">Prince George's County Data</caption>
## <tr>
## <th scope="col">Breakdown by</th>
##                  <th scope="col">Primary</th>
##                  <th scope="col">General</th>
##                  <th scope="col">Ballot Questions</th>
##              </tr>
## <tr>
## <td>County Results</td>
##                  <td>
## <a href="Prince_Georges_County_Democratic_2012_Primary.csv">Democrat</a><br><a href="Prince_Georges_County_Republican_2012_Primary.csv">Republican</a><br><a href="Prince_Georges_County_NonPartisan_2012_Primary.csv">Non-Partisan</a> </td>
##                  <td>
##                      <a href="Prince_Georges_County_2012_General.csv">General</a>                    </td>
##                  <td>
##                      <a href="Prince_Georges_Questions_County_2012.csv">Ballot Questions</a>                 </td>
##              </tr>
## <tr>
## <td>Precinct Results</td>
##                  <td>
## <a href="Prince_Georges_By_Precinct_Democratic_2012_Primary.csv">Democrat</a><br><a href="Prince_Georges_By_Precinct_Republican_2012_Primary.csv">Republican</a><br><a href="Prince_Georges_By_Precinct_NonPartisan_2012_Primary.csv">Non-Partisan</a> </td>
##                  <td>
##                      <a href="Prince_Georges_By_Precinct_2012_General.csv">General</a>                   </td>
##                  <td>
##                      <a href="Prince_Georges_Questions_Precinct_2012.csv">Ballot Questions</a>                   </td>
##              </tr>
## <tr>
## <td>Councilmanic and<br> Commissioner<br> Districts</td>
##                  <td>
## <a href="Prince_Georges_Local_Legislative_Districts_Democratic_2012_Primary.csv">Democrat</a><br><a href="Prince_Georges_Local_Legislative_Districts_Republican_2012_Primary.csv">Republican</a><br><a href="Prince_Georges_Local_Legislative_Districts_NonPartisan_2012_Primary.csv">Non-Partisan</a> </td>
##                  <td>
##                      <a href="Prince_Georges_Local_Legislative_Districts_2012_General.csv">General</a>                   </td>
##                  <td>
##                      <a href="Prince_Georges_Questions_Local_Legislative_Districts_2012.csv">Ballot Questions</a>                    </td>
##              </tr>
## </table>
## </div>
##          <br><div class="device_overflow">This table may scroll left to right depending on the screen size of your device.</div>
## <div class="mdgov_OverflowTable">
##     <table class="ui-table table-stripe" width="92%" border="1" cellpadding="4" cellspacing="1">
## <caption align="left">Queen Anne's County Data</caption>
## <tr>
## <th scope="col">Breakdown by</th>
##                  <th scope="col">Primary</th>
##                  <th scope="col">General</th>
##                  <th scope="col">Ballot Questions</th>
##              </tr>
## <tr>
## <td>County Results</td>
##                  <td>
## <a href="Queen_Annes_County_Democratic_2012_Primary.csv">Democrat</a><br><a href="Queen_Annes_County_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Queen_Annes_County_2012_General.csv">General</a>                   </td>
##                  <td>
##                      <a href="Queen_Annes_Questions_County_2012.csv">Ballot Questions</a>                    </td>
##              </tr>
## <tr>
## <td>Precinct Results</td>
##                  <td>
## <a href="Queen_Annes_By_Precinct_Democratic_2012_Primary.csv">Democrat</a><br><a href="Queen_Annes_By_Precinct_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Queen_Annes_By_Precinct_2012_General.csv">General</a>                  </td>
##                  <td>
##                      <a href="Queen_Annes_Questions_Precinct_2012.csv">Ballot Questions</a>                  </td>
##              </tr>
## <tr>
## <td>Councilmanic and<br> Commissioner<br> Districts</td>
##                  <td>
## <a href="Queen_Annes_Local_Legislative_Districts_Democratic_2012_Primary.csv">Democrat</a><br><a href="Queen_Annes_Local_Legislative_Districts_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Queen_Annes_Local_Legislative_Districts_2012_General.csv">General</a>                  </td>
##                  <td>
##                      <a href="Queen_Annes_Questions_Local_Legislative_Districts_2012.csv">Ballot Questions</a>                   </td>
##              </tr>
## </table>
## </div>
##          <br><div class="device_overflow">This table may scroll left to right depending on the screen size of your device.</div>
## <div class="mdgov_OverflowTable">
##     <table class="ui-table table-stripe" width="92%" border="1" cellpadding="4" cellspacing="1">
## <caption align="left">St. Mary's County Data</caption>
## <tr>
## <th scope="col">Breakdown by</th>
## 
##                  <th scope="col">Primary</th>
##                  <th scope="col">General</th>
##                  <th scope="col">Ballot Questions</th>
##              </tr>
## <tr>
## <td>County Results</td>
##                  <td>
## <a href="St._Marys_County_Democratic_2012_Primary.csv">Democrat</a><br><a href="St._Marys_County_Republican_2012_Primary.csv">Republican</a><br><a href="St._Marys_County_NonPartisan_2012_Primary.csv">Non-Partisan</a> </td>
##                  <td>
##                      <a href="St._Marys_County_2012_General.csv">General</a>                 </td>
##                  <td>
##                      <a href="St._Marys_Questions_County_2012.csv">Ballot Questions</a>                  </td>
##              </tr>
## <tr>
## <td>Precinct Results</td>
##                  <td>
## <a href="St._Marys_By_Precinct_Democratic_2012_Primary.csv">Democrat</a><br><a href="St._Marys_By_Precinct_Republican_2012_Primary.csv">Republican</a><br><a href="St._Marys_By_Precinct_NonPartisan_2012_Primary.csv">Non-Partisan</a>
## </td>
##                  <td>
##                      <a href="St._Marys_By_Precinct_2012_General.csv">General</a>                    </td>
##                  <td>
##                      <a href="St._Marys_Questions_Precinct_2012.csv">Ballot Questions</a>                    </td>
##              </tr>
## <tr>
## <td>Councilmanic and<br> Commissioner<br> Districts</td>
##                  <td>
## <a href="St._Marys_Local_Legislative_Districts_Democratic_2012_Primary.csv">Democrat</a><br><a href="St._Marys_Local_Legislative_Districts_Republican_2012_Primary.csv">Republican</a><br><a href="St._Marys_Local_Legislative_Districts_NonPartisan_2012_Primary.csv">Non-Partisan</a> </td>
##                  <td>
##                      <a href="St._Marys_Local_Legislative_Districts_2012_General.csv">General</a>                    </td>
##                  <td>
##                      <a href="St._Marys_Questions_Local_Legislative_Districts_2012.csv">Ballot Questions</a>                 </td>
##              </tr>
## </table>
## </div>
##          <br><div class="device_overflow">This table may scroll left to right depending on the screen size of your device.</div>
## <div class="mdgov_OverflowTable">
##     <table class="ui-table table-stripe" width="92%" border="1" cellpadding="4" cellspacing="1">
## <caption align="left">Somerset County Data</caption>
## <tr>
## <th scope="col">Breakdown by</th>
##                  <th scope="col">Primary</th>
##                  <th scope="col">General</th>
##                  <th scope="col">Ballot Questions</th>
##              </tr>
## <tr>
## <td>County Results</td>
##                  <td>
## <a href="Somerset_County_Democratic_2012_Primary.csv">Democrat</a><br><a href="Somerset_County_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Somerset_County_2012_General.csv">General</a>                  </td>
##                  <td>
##                      <a href="Somerset_Questions_County_2012.csv">Ballot Questions</a>                   </td>
##              </tr>
## <tr>
## <td>Precinct Results</td>
##                  <td>
## <a href="Somerset_By_Precinct_Democratic_2012_Primary.csv">Democrat</a><br><a href="Somerset_By_Precinct_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Somerset_By_Precinct_2012_General.csv">General</a>                 </td>
##                  <td>
##                      <a href="Somerset_Questions_Precinct_2012.csv">Ballot Questions</a>                 </td>
##              </tr>
## <tr>
## <td>Councilmanic and<br> Commissioner<br> Districts</td>
##                  <td>
## <a href="Somerset_Local_Legislative_Districts_Democratic_2012_Primary.csv">Democrat</a><br><a href="Somerset_Local_Legislative_Districts_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Somerset_Local_Legislative_Districts_2012_General.csv">General</a>                 </td>
##                  <td>
##                      <a href="Somerset_Questions_Local_Legislative_Districts_2012.csv">Ballot Questions</a>                  </td>
##              </tr>
## </table>
## </div>
##          <br><div class="device_overflow">This table may scroll left to right depending on the screen size of your device.</div>
## <div class="mdgov_OverflowTable">
##     <table class="ui-table table-stripe" width="92%" border="1" cellpadding="4" cellspacing="1">
## <caption align="left">Talbot County Data</caption>
## <tr>
## <th scope="col">Breakdown by</th>
##                  <th scope="col">Primary</th>
##                  <th scope="col">General</th>
##                  <th scope="col">Ballot Questions</th>
##              </tr>
## <tr>
## <td>County Results</td>
##                  <td>
## <a href="Talbot_County_Democratic_2012_Primary.csv">Democrat</a><br><a href="Talbot_County_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
## 
##                      <a href="Talbot_County_2012_General.csv">General</a>                    </td>
##                  <td>
##                      <a href="Talbot_Questions_County_2012.csv">Ballot Questions</a>                 </td>
##              </tr>
## <tr>
## <td>Precinct Results</td>
##                  <td>
## <a href="Talbot_By_Precinct_Democratic_2012_Primary.csv">Democrat</a><br><a href="Talbot_By_Precinct_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Talbot_By_Precinct_2012_General.csv">General</a>                   </td>
##                  <td>
##                      <a href="Talbot_Questions_Precinct_2012.csv">Ballot Questions</a>                   </td>
##              </tr>
## <tr>
## <td>Councilmanic and<br> Commissioner<br> Districts</td>
##                  <td>
## <a href="Talbot_Local_Legislative_Districts_Democratic_2012_Primary.csv">Democrat</a><br><a href="Talbot_Local_Legislative_Districts_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Talbot_Local_Legislative_Districts_2012_General.csv">General</a>                   </td>
##                  <td>
##                      <a href="Talbot_Questions_Local_Legislative_Districts_2012.csv">Ballot Questions</a>                    </td>
##              </tr>
## </table>
## </div>
##          <br><div class="device_overflow">This table may scroll left to right depending on the screen size of your device.</div>
## <div class="mdgov_OverflowTable">
##     <table class="ui-table table-stripe" width="92%" border="1" cellpadding="4" cellspacing="1">
## <caption align="left">Washington County Data</caption>
## <tr>
## <th scope="col">Breakdown by</th>
##                  <th scope="col">Primary</th>
##                  <th scope="col">General</th>
##                  <th scope="col">Ballot Questions</th>
##              </tr>
## <tr>
## <td>County Results</td>
##                  <td>
## <a href="Washington_County_Democratic_2012_Primary.csv">Democrat</a><br><a href="Washington_County_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Washington_County_2012_General.csv">General</a>                    </td>
##                  <td>
##                      <a href="Washington_Questions_County_2012.csv">Ballot Questions</a>                 </td>
##              </tr>
## <tr>
## <td>Precinct Results</td>
##                  <td>
## <a href="Washington_By_Precinct_Democratic_2012_Primary.csv">Democrat</a><br><a href="Washington_By_Precinct_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Washington_By_Precinct_2012_General.csv">General</a>                   </td>
##                  <td>
##                      <a href="Washington_Questions_Precinct_2012.csv">Ballot Questions</a>                   </td>
##              </tr>
## </table>
## </div>
##          <br><div class="device_overflow">This table may scroll left to right depending on the screen size of your device.</div>
## <div class="mdgov_OverflowTable">
##     <table class="ui-table table-stripe" width="92%" border="1" cellpadding="4" cellspacing="1">
## <caption align="left">Wicomico County Data</caption>
## <tr>
## <th scope="col">Breakdown by</th>
##                  <th scope="col">Primary</th>
##                  <th scope="col">General</th>
##                  <th scope="col">Ballot Questions</th>
##              </tr>
## <tr>
## <td>County Results</td>
##                  <td>
## <a href="Wicomico_County_Democratic_2012_Primary.csv">Democrat</a><br><a href="Wicomico_County_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Wicomico_County_2012_General.csv">General</a>                  </td>
##                  <td>
##                      <a href="Wicomico_Questions_County_2012.csv">Ballot Questions</a>                   </td>
##              </tr>
## <tr>
## <td>Precinct Results</td>
##                  <td>
## <a href="Wicomico_By_Precinct_Democratic_2012_Primary.csv">Democrat</a><br><a href="Wicomico_By_Precinct_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Wicomico_By_Precinct_2012_General.csv">General</a>                 </td>
##                  <td>
##                      <a href="Wicomico_Questions_Precinct_2012.csv">Ballot Questions</a>                 </td>
##              </tr>
## <tr>
## <td>Councilmanic and<br> Commissioner<br> Districts</td>
##                  <td>
## <a href="Wicomico_Local_Legislative_Districts_Democratic_2012_Primary.csv">Democrat</a><br><a href="Wicomico_Local_Legislative_Districts_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Wicomico_Local_Legislative_Districts_2012_General.csv">General</a>                 </td>
##                  <td>
##                      <a href="Wicomico_Questions_Local_Legislative_Districts_2012.csv">Ballot Questions</a>                  </td>
##              </tr>
## </table>
## </div>
##          <br><div class="device_overflow">This table may scroll left to right depending on the screen size of your device.</div>
## <div class="mdgov_OverflowTable">
##     <table class="ui-table table-stripe" width="92%" border="1" cellpadding="4" cellspacing="1">
## <caption align="left">Worcester County Data</caption>
## <tr>
## <th scope="col">Breakdown by</th>
##                  <th scope="col">Primary</th>
##                  <th scope="col">General</th>
##                  <th scope="col">Ballot Questions</th>
##              </tr>
## <tr>
## <td>County Results</td>
##                  <td>
## <a href="Worcester_County_Democratic_2012_Primary.csv">Democrat</a><br><a href="Worcester_County_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Worcester_County_2012_General.csv">General</a>                 </td>
##                  <td>
##                      <a href="Worcester_Questions_County_2012.csv">Ballot Questions</a>                  </td>
##              </tr>
## <tr>
## <td>Precinct Results</td>
##                  <td>
## <a href="Worcester_By_Precinct_Democratic_2012_Primary.csv">Democrat</a><br><a href="Worcester_By_Precinct_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Worcester_By_Precinct_2012_General.csv">General</a>                    </td>
##                  <td>
##                      <a href="Worcester_Questions_Precinct_2012.csv">Ballot Questions</a>                    </td>
##              </tr>
## <tr>
## <td>Councilmanic and<br> Commissioner<br> Districts</td>
##                  <td>
## <a href="Worcester_Local_Legislative_Districts_Democratic_2012_Primary.csv">Democrat</a><br><a href="Worcester_Local_Legislative_Districts_Republican_2012_Primary.csv">Republican</a>
## </td>
##                  <td>
##                      <a href="Worcester_Local_Legislative_Districts_2012_General.csv">General</a>                    </td>
##                  <td>
##                      <a href="Worcester_Questions_Local_Legislative_Districts_2012.csv">Ballot Questions</a>                 </td>
##              </tr>
## <tr></tr>
## </table>
## </div>
##                     <br><!-- InstanceEndEditable -->
## </div>
##                  </div>
##                      </div>
##                     
##          </div>
##          <div class="row-fluid">
##                 <div id="footer_block" class="clearfix">
##                     <div class="span9">
##                         <div id="footer_left">
##                             <div class="cl_base_hNav footerLinks">
##                             <!-- Step 12: Add agency footer links -->
##                                 <ul>
## <li><a href="../../../about/index.html">About Us</a></li>                      <li><a href="../../../about/contact.html">Contact SBE</a></li>
##                                 <li><a href="../../../about/county_boards.html">Contact your Local Board of Elections</a></li> 
##                                  <li><a href="../../../privacy.html">Privacy</a></li>
##                                  <li><a href="../../../accessibility.html">Accessibility</a></li> 
##                                 </ul>
## </div>
##                             <!-- Step 13 : Add agency address and phone -->
##                             <p>151 West Street, Suite 200, Annapolis, MD 21401</p>
##                          <p>(410) 269-2840 / (800) 222-8683 / <a href="mailto:info.sbe@maryland.gov">info.sbe@maryland.gov</a></p>
##                         </div>
##                     </div>
##                     <div class="span3">
##                         <div id="footer_right" class="clearfix">
##                             <div class="mdgov_socialNav">
##                             <!-- Step 6 : configure footer social media icons and links -->
##                                 <ul class="cl_base_hNav cl_socialNav">
## <li><a href="https://www.facebook.com/MarylandStateBoardofElections" class="sm-facebook" title="Facebook">Facebook</a></li>
##                              <li><a href="https://twitter.com/md_sbe" class="sm-twitter" title="Twitter">Twitter</a></li>
##                                     <!-- <li><a href="#" class="sm-googleplus" title="Google+">Google Plus</a></li>
##                                     <li><a href="#" class="sm-flickr" title="Flickr">Flickr</a></li>
##                                     <li><a href="#" class="sm-youtube" title="YouTube">YouTube</a></li>-->
##                                     <li class="last-child"><a href="http://www.maryland.gov/pages/social_media.aspx" class="sm-all" title="MD Social Media Directory">MD Social Media Directory</a></li>
##                                 </ul>
## <!--if no agy social media,replace above UL with code below--><!--<ul class="cl_base_hNav cl_socialNavDirectory">
##                                      <li class="last-child"><a href="http://www.maryland.gov/pages/social_media.aspx" class="sm-directory" title="MD Social Media Directory">MD Social Media Directory</a></li>
##                              </ul>-->
## </div>
##                         </div>
##                     </div>
##                  </div>
##              </div>
##      </div>
##         <script src="../../../egov/js/base.js"></script>
## </div>
## </body>
## <!-- InstanceEnd -->
## </html>
## 
links <- getHTMLLinks(page_parsed)
links
##   [1] "http://www.maryland.gov/"                                               
##   [2] "../../../index.html"                                                    
##   [3] "../../../index.html"                                                    
##   [4] "https://www.facebook.com/MarylandStateBoardofElections"                 
##   [5] "https://twitter.com/md_sbe"                                             
##   [6] "https://www.maryland.gov/pages/social_media.aspx"                       
##   [7] "../../../index.html"                                                    
##   [8] "../../../campaign_finance/index.html"                                   
##   [9] "../../../candidacy/index.html"                                          
##  [10] "../../2020/index.html"                                                  
##  [11] "../../../voter_registration/index.html"                                 
##  [12] "../../../voting/index.html"                                             
##  [13] "../../2020/index.html"                                                  
##  [14] "../../2018/index.html"                                                  
##  [15] "../../2016/index.html"                                                  
##  [16] "../../2014/index.html"                                                  
##  [17] "../index.html"                                                          
##  [18] "../../baltimore/2011.html"                                              
##  [19] "../../2010/index.html"                                                  
##  [20] "../../2008/index.html"                                                  
##  [21] "../../baltimore/2007.html"                                              
##  [22] "../../2006/index.html"                                                  
##  [23] "../../2004/index.html"                                                  
##  [24] "../../baltimore/2003.html"                                              
##  [25] "../../2002/index.html"                                                  
##  [26] "../../2000/index.html"                                                  
##  [27] "../../baltimore/1999.html"                                              
##  [28] "../../1998/index.html"                                                  
##  [29] "../../1996/index.html"                                                  
##  [30] "../../baltimore/1995.html"                                              
##  [31] "../../1994/index.html"                                                  
##  [32] "../../1992/index.html"                                                  
##  [33] "../../baltimore/1991.html"                                              
##  [34] "../../1990/index.html"                                                  
##  [35] "../../1988/index.html"                                                  
##  [36] "../../baltimore/1987.html"                                              
##  [37] "../../1986/index.html"                                                  
##  [38] "../../baltimore/1983.html"                                              
##  [39] "../../special_elections.html"                                           
##  [40] "../../districts.html"                                                   
##  [41] "../../electoral_college.html"                                           
##  [42] "../../presidential.html"                                                
##  [43] "../../using_election_data_instructions.html"                            
##  [44] "state_precinct_reference_2012_general.xls"                              
##  [45] "state_precinct_reference_2012_primary.xls"                              
##  [46] "State_Congressional_Districts_Democratic_2012_Primary.csv"              
##  [47] "State_Congressional_Districts_Republican_2012_Primary.csv"              
##  [48] "State_Congressional_Districts_NonPartisan_2012_Primary.csv"             
##  [49] "State_Congressional_Districts_2012_General.csv"                         
##  [50] "Questions_State_Congressional_Districts_2012.csv"                       
##  [51] "State_Legislative_Districts_Democratic_2012_Primary.csv"                
##  [52] "State_Legislative_Districts_Republican_2012_Primary.csv"                
##  [53] "State_Legislative_Districts_NonPartisan_2012_Primary.csv"               
##  [54] "State_Legislative_Districts_2012_General.csv"                           
##  [55] "Questions_State_Legislative_Districts_2012.csv"                         
##  [56] "All_By_Precinct_Democratic_2012_Primary.csv"                            
##  [57] "All_By_Precinct_Republican_2012_Primary.csv"                            
##  [58] "All_By_Precinct_NonPartisan_2012_Primary.csv"                           
##  [59] "All_By_Precinct_2012_General.csv"                                       
##  [60] "ALL_Questions_Precinct_2012.csv"                                        
##  [61] "Allegany_County_Democratic_2012_Primary.csv"                            
##  [62] "Allegany_County_Republican_2012_Primary.csv"                            
##  [63] "Allegany_County_NonPartisan_2012_Primary.csv"                           
##  [64] "Allegany_County_2012_General.csv"                                       
##  [65] "Allegany_Questions_County_2012.csv"                                     
##  [66] "Allegany_By_Precinct_Democratic_2012_Primary.csv"                       
##  [67] "Allegany_By_Precinct_Republican_2012_Primary.csv"                       
##  [68] "Allegany_By_Precinct_NonPartisan_2012_Primary.csv"                      
##  [69] "Allegany_By_Precinct_2012_General.csv"                                  
##  [70] "Allegany_Questions_Precinct_2012.csv"                                   
##  [71] "Anne_Arundel_County_Democratic_2012_Primary.csv"                        
##  [72] "Anne_Arundel_County_Republican_2012_Primary.csv"                        
##  [73] "Anne_Arundel_County_2012_General.csv"                                   
##  [74] "Anne_Arundel_Questions_County_2012.csv"                                 
##  [75] "Anne_Arundel_By_Precinct_Democratic_2012_Primary.csv"                   
##  [76] "Anne_Arundel_By_Precinct_Republican_2012_Primary.csv"                   
##  [77] "Anne_Arundel_By_Precinct_2012_General.csv"                              
##  [78] "Anne_Arundel_Questions_Precinct_2012.csv"                               
##  [79] "Anne_Arundel_Local_Legislative_Districts_Democratic_2012_Primary.csv"   
##  [80] "Anne_Arundel_Local_Legislative_Districts_Republican_2012_Primary.csv"   
##  [81] "Anne_Arundel_Local_Legislative_Districts_2012_General.csv"              
##  [82] "Anne_Arundel_Questions_Local_Legislative_Districts_2012.csv"            
##  [83] "Baltimore_City_County_Democratic_2012_Primary.csv"                      
##  [84] "Baltimore_City_County_Republican_2012_Primary.csv"                      
##  [85] "Baltimore_City_County_2012_General.csv"                                 
##  [86] "Baltimore_City_Questions_County_2012.csv"                               
##  [87] "Baltimore_City_By_Precinct_Democratic_2012_Primary.csv"                 
##  [88] "Baltimore_City_By_Precinct_Republican_2012_Primary.csv"                 
##  [89] "Baltimore_City_By_Precinct_2012_General.csv"                            
##  [90] "Baltimore_City_Questions_Precinct_2012.csv"                             
##  [91] "Baltimore_City_Local_Legislative_Districts_Democratic_2012_Primary.csv" 
##  [92] "Baltimore_City_Local_Legislative_Districts_Republican_2012_Primary.csv" 
##  [93] "Baltimore_City_Local_Legislative_Districts_2012_General.csv"            
##  [94] "Baltimore_City_Questions_Local_Legislative_Districts_2012.csv"          
##  [95] "Baltimore_County_Democratic_2012_Primary.csv"                           
##  [96] "Baltimore_County_Republican_2012_Primary.csv"                           
##  [97] "Baltimore_County_2012_General.csv"                                      
##  [98] "Baltimore_Questions_County_2012.csv"                                    
##  [99] "Baltimore_By_Precinct_Democratic_2012_Primary.csv"                      
## [100] "Baltimore_By_Precinct_Republican_2012_Primary.csv"                      
## [101] "Baltimore_By_Precinct_2012_General.csv"                                 
## [102] "Baltimore_Questions_Precinct_2012.csv"                                  
## [103] "Baltimore_Local_Legislative_Districts_Democratic_2012_Primary.csv"      
## [104] "Baltimore_Local_Legislative_Districts_Republican_2012_Primary.csv"      
## [105] "Baltimore_Local_Legislative_Districts_2012_General.csv"                 
## [106] "Baltimore_Questions_Local_Legislative_Districts_2012.csv"               
## [107] "Calvert_County_Democratic_2012_Primary.csv"                             
## [108] "Calvert_County_Republican_2012_Primary.csv"                             
## [109] "Calvert_County_2012_General.csv"                                        
## [110] "Calvert_Questions_County_2012.csv"                                      
## [111] "Calvert_By_Precinct_Democratic_2012_Primary.csv"                        
## [112] "Calvert_By_Precinct_Republican_2012_Primary.csv"                        
## [113] "Calvert_By_Precinct_2012_General.csv"                                   
## [114] "Calvert_Questions_Precinct_2012.csv"                                    
## [115] "Calvert_Local_Legislative_Districts_Democratic_2012_Primary.csv"        
## [116] "Calvert_Local_Legislative_Districts_Republican_2012_Primary.csv"        
## [117] "Calvert_Local_Legislative_Districts_2012_General.csv"                   
## [118] "Calvert_Questions_Local_Legislative_Districts_2012.csv"                 
## [119] "Caroline_County_Democratic_2012_Primary.csv"                            
## [120] "Caroline_County_Republican_2012_Primary.csv"                            
## [121] "Caroline_County_NonPartisan_2012_Primary.csv"                           
## [122] "Caroline_County_2012_General.csv"                                       
## [123] "Caroline_Questions_County_2012.csv"                                     
## [124] "Caroline_By_Precinct_Democratic_2012_Primary.csv"                       
## [125] "Caroline_By_Precinct_Republican_2012_Primary.csv"                       
## [126] "Caroline_By_Precinct_NonPartisan_2012_Primary.csv"                      
## [127] "Caroline_By_Precinct_2012_General.csv"                                  
## [128] "Caroline_Questions_Precinct_2012.csv"                                   
## [129] "Carroll_County_Democratic_2012_Primary.csv"                             
## [130] "Carroll_County_Republican_2012_Primary.csv"                             
## [131] "Carroll_County_NonPartisan_2012_Primary.csv"                            
## [132] "Carroll_County_2012_General.csv"                                        
## [133] "Carroll_Questions_County_2012.csv"                                      
## [134] "Carroll_By_Precinct_Democratic_2012_Primary.csv"                        
## [135] "Carroll_By_Precinct_Republican_2012_Primary.csv"                        
## [136] "Carroll_By_Precinct_NonPartisan_2012_Primary.csv"                       
## [137] "Carroll_By_Precinct_2012_General.csv"                                   
## [138] "Carroll_Questions_Precinct_2012.csv"                                    
## [139] "Carroll_Local_Legislative_Districts_Democratic_2012_Primary.csv"        
## [140] "Carroll_Local_Legislative_Districts_Republican_2012_Primary.csv"        
## [141] "Carroll_Local_Legislative_Districts_NonPartisan_2012_Primary.csv"       
## [142] "Carroll_Local_Legislative_Districts_2012_General.csv"                   
## [143] "Carroll_Questions_Local_Legislative_Districts_2012.csv"                 
## [144] "Cecil_County_Democratic_2012_Primary.csv"                               
## [145] "Cecil_County_Republican_2012_Primary.csv"                               
## [146] "Cecil_County_2012_General.csv"                                          
## [147] "Cecil_Questions_County_2012.csv"                                        
## [148] "Cecil_By_Precinct_Democratic_2012_Primary.csv"                          
## [149] "Cecil_By_Precinct_Republican_2012_Primary.csv"                          
## [150] "Cecil_By_Precinct_2012_General.csv"                                     
## [151] "Cecil_Questions_Precinct_2012.csv"                                      
## [152] "Cecil_Local_Legislative_Districts_Democratic_2012_Primary.csv"          
## [153] "Cecil_Local_Legislative_Districts_Republican_2012_Primary.csv"          
## [154] "Cecil_Local_Legislative_Districts_2012_General.csv"                     
## [155] "Cecil_Questions_Local_Legislative_Districts_2012.csv"                   
## [156] "Charles_County_Democratic_2012_Primary.csv"                             
## [157] "Charles_County_Republican_2012_Primary.csv"                             
## [158] "Charles_County_2012_General.csv"                                        
## [159] "Charles_Questions_County_2012.csv"                                      
## [160] "Charles_By_Precinct_Democratic_2012_Primary.csv"                        
## [161] "Charles_By_Precinct_Republican_2012_Primary.csv"                        
## [162] "Charles_By_Precinct_2012_General.csv"                                   
## [163] "Charles_Questions_Precinct_2012.csv"                                    
## [164] "Charles_Local_Legislative_Districts_Democratic_2012_Primary.csv"        
## [165] "Charles_Local_Legislative_Districts_Republican_2012_Primary.csv"        
## [166] "Charles_Local_Legislative_Districts_2012_General.csv"                   
## [167] "Charles_Questions_Local_Legislative_Districts_2012.csv"                 
## [168] "Dorchester_County_Democratic_2012_Primary.csv"                          
## [169] "Dorchester_County_Republican_2012_Primary.csv"                          
## [170] "Dorchester_County_NonPartisan_2012_Primary.csv"                         
## [171] "Dorchester_County_2012_General.csv"                                     
## [172] "Dorchester_Questions_County_2012.csv"                                   
## [173] "Dorchester_By_Precinct_Democratic_2012_Primary.csv"                     
## [174] "Dorchester_By_Precinct_Republican_2012_Primary.csv"                     
## [175] "Dorchester_By_Precinct_NonPartisan_2012_Primary.csv"                    
## [176] "Dorchester_By_Precinct_2012_General.csv"                                
## [177] "Dorchester_Questions_Precinct_2012.csv"                                 
## [178] "Dorchester_Local_Legislative_Districts_Democratic_2012_Primary.csv"     
## [179] "Dorchester_Local_Legislative_Districts_Republican_2012_Primary.csv"     
## [180] "Dorchester_Local_Legislative_Districts_NonPartisan_2012_Primary.csv"    
## [181] "Dorchester_Local_Legislative_Districts_2012_General.csv"                
## [182] "Dorchester_Questions_Local_Legislative_Districts_2012.csv"              
## [183] "Frederick_County_Democratic_2012_Primary.csv"                           
## [184] "Frederick_County_Republican_2012_Primary.csv"                           
## [185] "Frederick_County_NonPartisan_2012_Primary.csv"                          
## [186] "Frederick_County_2012_General.csv"                                      
## [187] "Frederick_Questions_County_2012.csv"                                    
## [188] "Frederick_By_Precinct_Democratic_2012_Primary.csv"                      
## [189] "Frederick_By_Precinct_Republican_2012_Primary.csv"                      
## [190] "Frederick_By_Precinct_NonPartisan_2012_Primary.csv"                     
## [191] "Frederick_By_Precinct_2012_General.csv"                                 
## [192] "Frederick_Questions_Precinct_2012.csv"                                  
## [193] "Garrett_County_Democratic_2012_Primary.csv"                             
## [194] "Garrett_County_Republican_2012_Primary.csv"                             
## [195] "Garrett_County_2012_General.csv"                                        
## [196] "Garrett_Questions_County_2012.csv"                                      
## [197] "Garrett_By_Precinct_Democratic_2012_Primary.csv"                        
## [198] "Garrett_By_Precinct_Republican_2012_Primary.csv"                        
## [199] "Garrett_By_Precinct_2012_General.csv"                                   
## [200] "Garrett_Questions_Precinct_2012.csv"                                    
## [201] "Garrett_Local_Legislative_Districts_Democratic_2012_Primary.csv"        
## [202] "Garrett_Local_Legislative_Districts_Republican_2012_Primary.csv"        
## [203] "Garrett_Local_Legislative_Districts_2012_General.csv"                   
## [204] "Garrett_Questions_Local_Legislative_Districts_2012.csv"                 
## [205] "Harford_County_Democratic_2012_Primary.csv"                             
## [206] "Harford_County_Republican_2012_Primary.csv"                             
## [207] "Harford_County_2012_General.csv"                                        
## [208] "Harford_Questions_County_2012.csv"                                      
## [209] "Harford_By_Precinct_Democratic_2012_Primary.csv"                        
## [210] "Harford_By_Precinct_Republican_2012_Primary.csv"                        
## [211] "Harford_By_Precinct_2012_General.csv"                                   
## [212] "Harford_Questions_Precinct_2012.csv"                                    
## [213] "Harford_Local_Legislative_Districts_Democratic_2012_Primary.csv"        
## [214] "Harford_Local_Legislative_Districts_Republican_2012_Primary.csv"        
## [215] "Harford_Local_Legislative_Districts_2012_General.csv"                   
## [216] "Harford_Questions_Local_Legislative_Districts_2012.csv"                 
## [217] "Howard_County_Democratic_2012_Primary.csv"                              
## [218] "Howard_County_Republican_2012_Primary.csv"                              
## [219] "Howard_County_NonPartisan_2012_Primary.csv"                             
## [220] "Howard_County_2012_General.csv"                                         
## [221] "Howard_Questions_County_2012.csv"                                       
## [222] "Howard_By_Precinct_Democratic_2012_Primary.csv"                         
## [223] "Howard_By_Precinct_Republican_2012_Primary.csv"                         
## [224] "Howard_By_Precinct_NonPartisan_2012_Primary.csv"                        
## [225] "Howard_By_Precinct_2012_General.csv"                                    
## [226] "Howard_Questions_Precinct_2012.csv"                                     
## [227] "Howard_Local_Legislative_Districts_Democratic_2012_Primary.csv"         
## [228] "Howard_Local_Legislative_Districts_Republican_2012_Primary.csv"         
## [229] "Howard_Local_Legislative_Districts_NonPartisan_2012_Primary.csv"        
## [230] "Howard_Local_Legislative_Districts_2012_General.csv"                    
## [231] "Howard_Questions_Local_Legislative_Districts_2012.csv"                  
## [232] "Kent_County_Democratic_2012_Primary.csv"                                
## [233] "Kent_County_Republican_2012_Primary.csv"                                
## [234] "Kent_County_2012_General.csv"                                           
## [235] "Kent_Questions_County_2012.csv"                                         
## [236] "Kent_By_Precinct_Democratic_2012_Primary.csv"                           
## [237] "Kent_By_Precinct_Republican_2012_Primary.csv"                           
## [238] "Kent_By_Precinct_2012_General.csv"                                      
## [239] "Kent_Questions_Precinct_2012.csv"                                       
## [240] "Montgomery_County_Democratic_2012_Primary.csv"                          
## [241] "Montgomery_County_Republican_2012_Primary.csv"                          
## [242] "Montgomery_County_NonPartisan_2012_Primary.csv"                         
## [243] "Montgomery_County_2012_General.csv"                                     
## [244] "Montgomery_Questions_County_2012.csv"                                   
## [245] "Montgomery_By_Precinct_Democratic_2012_Primary.csv"                     
## [246] "Montgomery_By_Precinct_Republican_2012_Primary.csv"                     
## [247] "Montgomery_By_Precinct_NonPartisan_2012_Primary.csv"                    
## [248] "Montgomery_By_Precinct_2012_General.csv"                                
## [249] "Montgomery_Questions_Precinct_2012.csv"                                 
## [250] "Montgomery_Local_Legislative_Districts_Democratic_2012_Primary.csv"     
## [251] "Montgomery_Local_Legislative_Districts_Republican_2012_Primary.csv"     
## [252] "Montgomery_Local_Legislative_Districts_NonPartisan_2012_Primary.csv"    
## [253] "Montgomery_Local_Legislative_Districts_2012_General.csv"                
## [254] "Montgomery_Questions_Local_Legislative_Districts_2012.csv"              
## [255] "Prince_Georges_County_Democratic_2012_Primary.csv"                      
## [256] "Prince_Georges_County_Republican_2012_Primary.csv"                      
## [257] "Prince_Georges_County_NonPartisan_2012_Primary.csv"                     
## [258] "Prince_Georges_County_2012_General.csv"                                 
## [259] "Prince_Georges_Questions_County_2012.csv"                               
## [260] "Prince_Georges_By_Precinct_Democratic_2012_Primary.csv"                 
## [261] "Prince_Georges_By_Precinct_Republican_2012_Primary.csv"                 
## [262] "Prince_Georges_By_Precinct_NonPartisan_2012_Primary.csv"                
## [263] "Prince_Georges_By_Precinct_2012_General.csv"                            
## [264] "Prince_Georges_Questions_Precinct_2012.csv"                             
## [265] "Prince_Georges_Local_Legislative_Districts_Democratic_2012_Primary.csv" 
## [266] "Prince_Georges_Local_Legislative_Districts_Republican_2012_Primary.csv" 
## [267] "Prince_Georges_Local_Legislative_Districts_NonPartisan_2012_Primary.csv"
## [268] "Prince_Georges_Local_Legislative_Districts_2012_General.csv"            
## [269] "Prince_Georges_Questions_Local_Legislative_Districts_2012.csv"          
## [270] "Queen_Annes_County_Democratic_2012_Primary.csv"                         
## [271] "Queen_Annes_County_Republican_2012_Primary.csv"                         
## [272] "Queen_Annes_County_2012_General.csv"                                    
## [273] "Queen_Annes_Questions_County_2012.csv"                                  
## [274] "Queen_Annes_By_Precinct_Democratic_2012_Primary.csv"                    
## [275] "Queen_Annes_By_Precinct_Republican_2012_Primary.csv"                    
## [276] "Queen_Annes_By_Precinct_2012_General.csv"                               
## [277] "Queen_Annes_Questions_Precinct_2012.csv"                                
## [278] "Queen_Annes_Local_Legislative_Districts_Democratic_2012_Primary.csv"    
## [279] "Queen_Annes_Local_Legislative_Districts_Republican_2012_Primary.csv"    
## [280] "Queen_Annes_Local_Legislative_Districts_2012_General.csv"               
## [281] "Queen_Annes_Questions_Local_Legislative_Districts_2012.csv"             
## [282] "St._Marys_County_Democratic_2012_Primary.csv"                           
## [283] "St._Marys_County_Republican_2012_Primary.csv"                           
## [284] "St._Marys_County_NonPartisan_2012_Primary.csv"                          
## [285] "St._Marys_County_2012_General.csv"                                      
## [286] "St._Marys_Questions_County_2012.csv"                                    
## [287] "St._Marys_By_Precinct_Democratic_2012_Primary.csv"                      
## [288] "St._Marys_By_Precinct_Republican_2012_Primary.csv"                      
## [289] "St._Marys_By_Precinct_NonPartisan_2012_Primary.csv"                     
## [290] "St._Marys_By_Precinct_2012_General.csv"                                 
## [291] "St._Marys_Questions_Precinct_2012.csv"                                  
## [292] "St._Marys_Local_Legislative_Districts_Democratic_2012_Primary.csv"      
## [293] "St._Marys_Local_Legislative_Districts_Republican_2012_Primary.csv"      
## [294] "St._Marys_Local_Legislative_Districts_NonPartisan_2012_Primary.csv"     
## [295] "St._Marys_Local_Legislative_Districts_2012_General.csv"                 
## [296] "St._Marys_Questions_Local_Legislative_Districts_2012.csv"               
## [297] "Somerset_County_Democratic_2012_Primary.csv"                            
## [298] "Somerset_County_Republican_2012_Primary.csv"                            
## [299] "Somerset_County_2012_General.csv"                                       
## [300] "Somerset_Questions_County_2012.csv"                                     
## [301] "Somerset_By_Precinct_Democratic_2012_Primary.csv"                       
## [302] "Somerset_By_Precinct_Republican_2012_Primary.csv"                       
## [303] "Somerset_By_Precinct_2012_General.csv"                                  
## [304] "Somerset_Questions_Precinct_2012.csv"                                   
## [305] "Somerset_Local_Legislative_Districts_Democratic_2012_Primary.csv"       
## [306] "Somerset_Local_Legislative_Districts_Republican_2012_Primary.csv"       
## [307] "Somerset_Local_Legislative_Districts_2012_General.csv"                  
## [308] "Somerset_Questions_Local_Legislative_Districts_2012.csv"                
## [309] "Talbot_County_Democratic_2012_Primary.csv"                              
## [310] "Talbot_County_Republican_2012_Primary.csv"                              
## [311] "Talbot_County_2012_General.csv"                                         
## [312] "Talbot_Questions_County_2012.csv"                                       
## [313] "Talbot_By_Precinct_Democratic_2012_Primary.csv"                         
## [314] "Talbot_By_Precinct_Republican_2012_Primary.csv"                         
## [315] "Talbot_By_Precinct_2012_General.csv"                                    
## [316] "Talbot_Questions_Precinct_2012.csv"                                     
## [317] "Talbot_Local_Legislative_Districts_Democratic_2012_Primary.csv"         
## [318] "Talbot_Local_Legislative_Districts_Republican_2012_Primary.csv"         
## [319] "Talbot_Local_Legislative_Districts_2012_General.csv"                    
## [320] "Talbot_Questions_Local_Legislative_Districts_2012.csv"                  
## [321] "Washington_County_Democratic_2012_Primary.csv"                          
## [322] "Washington_County_Republican_2012_Primary.csv"                          
## [323] "Washington_County_2012_General.csv"                                     
## [324] "Washington_Questions_County_2012.csv"                                   
## [325] "Washington_By_Precinct_Democratic_2012_Primary.csv"                     
## [326] "Washington_By_Precinct_Republican_2012_Primary.csv"                     
## [327] "Washington_By_Precinct_2012_General.csv"                                
## [328] "Washington_Questions_Precinct_2012.csv"                                 
## [329] "Wicomico_County_Democratic_2012_Primary.csv"                            
## [330] "Wicomico_County_Republican_2012_Primary.csv"                            
## [331] "Wicomico_County_2012_General.csv"                                       
## [332] "Wicomico_Questions_County_2012.csv"                                     
## [333] "Wicomico_By_Precinct_Democratic_2012_Primary.csv"                       
## [334] "Wicomico_By_Precinct_Republican_2012_Primary.csv"                       
## [335] "Wicomico_By_Precinct_2012_General.csv"                                  
## [336] "Wicomico_Questions_Precinct_2012.csv"                                   
## [337] "Wicomico_Local_Legislative_Districts_Democratic_2012_Primary.csv"       
## [338] "Wicomico_Local_Legislative_Districts_Republican_2012_Primary.csv"       
## [339] "Wicomico_Local_Legislative_Districts_2012_General.csv"                  
## [340] "Wicomico_Questions_Local_Legislative_Districts_2012.csv"                
## [341] "Worcester_County_Democratic_2012_Primary.csv"                           
## [342] "Worcester_County_Republican_2012_Primary.csv"                           
## [343] "Worcester_County_2012_General.csv"                                      
## [344] "Worcester_Questions_County_2012.csv"                                    
## [345] "Worcester_By_Precinct_Democratic_2012_Primary.csv"                      
## [346] "Worcester_By_Precinct_Republican_2012_Primary.csv"                      
## [347] "Worcester_By_Precinct_2012_General.csv"                                 
## [348] "Worcester_Questions_Precinct_2012.csv"                                  
## [349] "Worcester_Local_Legislative_Districts_Democratic_2012_Primary.csv"      
## [350] "Worcester_Local_Legislative_Districts_Republican_2012_Primary.csv"      
## [351] "Worcester_Local_Legislative_Districts_2012_General.csv"                 
## [352] "Worcester_Questions_Local_Legislative_Districts_2012.csv"               
## [353] "../../../about/index.html"                                              
## [354] "../../../about/contact.html"                                            
## [355] "../../../about/county_boards.html"                                      
## [356] "../../../privacy.html"                                                  
## [357] "../../../accessibility.html"                                            
## [358] "mailto:info.sbe@maryland.gov"                                           
## [359] "https://www.facebook.com/MarylandStateBoardofElections"                 
## [360] "https://twitter.com/md_sbe"                                             
## [361] "http://www.maryland.gov/pages/social_media.aspx"
class(links)
## [1] "character"
length(links)
## [1] 361
links[1]
## [1] "http://www.maryland.gov/"
links[c(TRUE,FALSE,T,F,T)]
##   [1] "http://www.maryland.gov/"                                              
##   [2] "../../../index.html"                                                   
##   [3] "https://twitter.com/md_sbe"                                            
##   [4] "https://www.maryland.gov/pages/social_media.aspx"                      
##   [5] "../../../campaign_finance/index.html"                                  
##   [6] "../../2020/index.html"                                                 
##   [7] "../../../voter_registration/index.html"                                
##   [8] "../../2020/index.html"                                                 
##   [9] "../../2016/index.html"                                                 
##  [10] "../../2014/index.html"                                                 
##  [11] "../../baltimore/2011.html"                                             
##  [12] "../../2008/index.html"                                                 
##  [13] "../../baltimore/2007.html"                                             
##  [14] "../../2004/index.html"                                                 
##  [15] "../../2002/index.html"                                                 
##  [16] "../../2000/index.html"                                                 
##  [17] "../../1998/index.html"                                                 
##  [18] "../../baltimore/1995.html"                                             
##  [19] "../../1994/index.html"                                                 
##  [20] "../../baltimore/1991.html"                                             
##  [21] "../../1988/index.html"                                                 
##  [22] "../../baltimore/1987.html"                                             
##  [23] "../../baltimore/1983.html"                                             
##  [24] "../../districts.html"                                                  
##  [25] "../../electoral_college.html"                                          
##  [26] "../../using_election_data_instructions.html"                           
##  [27] "state_precinct_reference_2012_primary.xls"                             
##  [28] "State_Congressional_Districts_Democratic_2012_Primary.csv"             
##  [29] "State_Congressional_Districts_NonPartisan_2012_Primary.csv"            
##  [30] "Questions_State_Congressional_Districts_2012.csv"                      
##  [31] "State_Legislative_Districts_Democratic_2012_Primary.csv"               
##  [32] "State_Legislative_Districts_NonPartisan_2012_Primary.csv"              
##  [33] "Questions_State_Legislative_Districts_2012.csv"                        
##  [34] "All_By_Precinct_Democratic_2012_Primary.csv"                           
##  [35] "All_By_Precinct_NonPartisan_2012_Primary.csv"                          
##  [36] "ALL_Questions_Precinct_2012.csv"                                       
##  [37] "Allegany_County_Democratic_2012_Primary.csv"                           
##  [38] "Allegany_County_NonPartisan_2012_Primary.csv"                          
##  [39] "Allegany_Questions_County_2012.csv"                                    
##  [40] "Allegany_By_Precinct_Democratic_2012_Primary.csv"                      
##  [41] "Allegany_By_Precinct_NonPartisan_2012_Primary.csv"                     
##  [42] "Allegany_Questions_Precinct_2012.csv"                                  
##  [43] "Anne_Arundel_County_Democratic_2012_Primary.csv"                       
##  [44] "Anne_Arundel_County_2012_General.csv"                                  
##  [45] "Anne_Arundel_By_Precinct_Democratic_2012_Primary.csv"                  
##  [46] "Anne_Arundel_By_Precinct_Republican_2012_Primary.csv"                  
##  [47] "Anne_Arundel_Questions_Precinct_2012.csv"                              
##  [48] "Anne_Arundel_Local_Legislative_Districts_Republican_2012_Primary.csv"  
##  [49] "Anne_Arundel_Local_Legislative_Districts_2012_General.csv"             
##  [50] "Baltimore_City_County_Democratic_2012_Primary.csv"                     
##  [51] "Baltimore_City_County_2012_General.csv"                                
##  [52] "Baltimore_City_Questions_County_2012.csv"                              
##  [53] "Baltimore_City_By_Precinct_Republican_2012_Primary.csv"                
##  [54] "Baltimore_City_Questions_Precinct_2012.csv"                            
##  [55] "Baltimore_City_Local_Legislative_Districts_Democratic_2012_Primary.csv"
##  [56] "Baltimore_City_Local_Legislative_Districts_2012_General.csv"           
##  [57] "Baltimore_County_Democratic_2012_Primary.csv"                          
##  [58] "Baltimore_County_Republican_2012_Primary.csv"                          
##  [59] "Baltimore_Questions_County_2012.csv"                                   
##  [60] "Baltimore_By_Precinct_Republican_2012_Primary.csv"                     
##  [61] "Baltimore_By_Precinct_2012_General.csv"                                
##  [62] "Baltimore_Local_Legislative_Districts_Democratic_2012_Primary.csv"     
##  [63] "Baltimore_Local_Legislative_Districts_2012_General.csv"                
##  [64] "Baltimore_Questions_Local_Legislative_Districts_2012.csv"              
##  [65] "Calvert_County_Republican_2012_Primary.csv"                            
##  [66] "Calvert_Questions_County_2012.csv"                                     
##  [67] "Calvert_By_Precinct_Democratic_2012_Primary.csv"                       
##  [68] "Calvert_By_Precinct_2012_General.csv"                                  
##  [69] "Calvert_Local_Legislative_Districts_Democratic_2012_Primary.csv"       
##  [70] "Calvert_Local_Legislative_Districts_Republican_2012_Primary.csv"       
##  [71] "Calvert_Questions_Local_Legislative_Districts_2012.csv"                
##  [72] "Caroline_County_Republican_2012_Primary.csv"                           
##  [73] "Caroline_County_NonPartisan_2012_Primary.csv"                          
##  [74] "Caroline_Questions_County_2012.csv"                                    
##  [75] "Caroline_By_Precinct_Republican_2012_Primary.csv"                      
##  [76] "Caroline_By_Precinct_NonPartisan_2012_Primary.csv"                     
##  [77] "Caroline_Questions_Precinct_2012.csv"                                  
##  [78] "Carroll_County_Republican_2012_Primary.csv"                            
##  [79] "Carroll_County_NonPartisan_2012_Primary.csv"                           
##  [80] "Carroll_Questions_County_2012.csv"                                     
##  [81] "Carroll_By_Precinct_Republican_2012_Primary.csv"                       
##  [82] "Carroll_By_Precinct_NonPartisan_2012_Primary.csv"                      
##  [83] "Carroll_Questions_Precinct_2012.csv"                                   
##  [84] "Carroll_Local_Legislative_Districts_Republican_2012_Primary.csv"       
##  [85] "Carroll_Local_Legislative_Districts_NonPartisan_2012_Primary.csv"      
##  [86] "Carroll_Questions_Local_Legislative_Districts_2012.csv"                
##  [87] "Cecil_County_Republican_2012_Primary.csv"                              
##  [88] "Cecil_County_2012_General.csv"                                         
##  [89] "Cecil_By_Precinct_Democratic_2012_Primary.csv"                         
##  [90] "Cecil_By_Precinct_2012_General.csv"                                    
##  [91] "Cecil_Questions_Precinct_2012.csv"                                     
##  [92] "Cecil_Local_Legislative_Districts_Republican_2012_Primary.csv"         
##  [93] "Cecil_Questions_Local_Legislative_Districts_2012.csv"                  
##  [94] "Charles_County_Democratic_2012_Primary.csv"                            
##  [95] "Charles_County_2012_General.csv"                                       
##  [96] "Charles_By_Precinct_Democratic_2012_Primary.csv"                       
##  [97] "Charles_By_Precinct_Republican_2012_Primary.csv"                       
##  [98] "Charles_Questions_Precinct_2012.csv"                                   
##  [99] "Charles_Local_Legislative_Districts_Republican_2012_Primary.csv"       
## [100] "Charles_Local_Legislative_Districts_2012_General.csv"                  
## [101] "Dorchester_County_Democratic_2012_Primary.csv"                         
## [102] "Dorchester_County_NonPartisan_2012_Primary.csv"                        
## [103] "Dorchester_County_2012_General.csv"                                    
## [104] "Dorchester_By_Precinct_Democratic_2012_Primary.csv"                    
## [105] "Dorchester_By_Precinct_NonPartisan_2012_Primary.csv"                   
## [106] "Dorchester_By_Precinct_2012_General.csv"                               
## [107] "Dorchester_Local_Legislative_Districts_Democratic_2012_Primary.csv"    
## [108] "Dorchester_Local_Legislative_Districts_NonPartisan_2012_Primary.csv"   
## [109] "Dorchester_Local_Legislative_Districts_2012_General.csv"               
## [110] "Frederick_County_Democratic_2012_Primary.csv"                          
## [111] "Frederick_County_NonPartisan_2012_Primary.csv"                         
## [112] "Frederick_County_2012_General.csv"                                     
## [113] "Frederick_By_Precinct_Democratic_2012_Primary.csv"                     
## [114] "Frederick_By_Precinct_NonPartisan_2012_Primary.csv"                    
## [115] "Frederick_By_Precinct_2012_General.csv"                                
## [116] "Garrett_County_Democratic_2012_Primary.csv"                            
## [117] "Garrett_County_2012_General.csv"                                       
## [118] "Garrett_Questions_County_2012.csv"                                     
## [119] "Garrett_By_Precinct_Republican_2012_Primary.csv"                       
## [120] "Garrett_Questions_Precinct_2012.csv"                                   
## [121] "Garrett_Local_Legislative_Districts_Democratic_2012_Primary.csv"       
## [122] "Garrett_Local_Legislative_Districts_2012_General.csv"                  
## [123] "Harford_County_Democratic_2012_Primary.csv"                            
## [124] "Harford_County_Republican_2012_Primary.csv"                            
## [125] "Harford_Questions_County_2012.csv"                                     
## [126] "Harford_By_Precinct_Republican_2012_Primary.csv"                       
## [127] "Harford_By_Precinct_2012_General.csv"                                  
## [128] "Harford_Local_Legislative_Districts_Democratic_2012_Primary.csv"       
## [129] "Harford_Local_Legislative_Districts_2012_General.csv"                  
## [130] "Harford_Questions_Local_Legislative_Districts_2012.csv"                
## [131] "Howard_County_Republican_2012_Primary.csv"                             
## [132] "Howard_County_2012_General.csv"                                        
## [133] "Howard_Questions_County_2012.csv"                                      
## [134] "Howard_By_Precinct_Republican_2012_Primary.csv"                        
## [135] "Howard_By_Precinct_2012_General.csv"                                   
## [136] "Howard_Questions_Precinct_2012.csv"                                    
## [137] "Howard_Local_Legislative_Districts_Republican_2012_Primary.csv"        
## [138] "Howard_Local_Legislative_Districts_2012_General.csv"                   
## [139] "Howard_Questions_Local_Legislative_Districts_2012.csv"                 
## [140] "Kent_County_Republican_2012_Primary.csv"                               
## [141] "Kent_Questions_County_2012.csv"                                        
## [142] "Kent_By_Precinct_Democratic_2012_Primary.csv"                          
## [143] "Kent_By_Precinct_2012_General.csv"                                     
## [144] "Montgomery_County_Democratic_2012_Primary.csv"                         
## [145] "Montgomery_County_Republican_2012_Primary.csv"                         
## [146] "Montgomery_County_2012_General.csv"                                    
## [147] "Montgomery_By_Precinct_Democratic_2012_Primary.csv"                    
## [148] "Montgomery_By_Precinct_Republican_2012_Primary.csv"                    
## [149] "Montgomery_By_Precinct_2012_General.csv"                               
## [150] "Montgomery_Local_Legislative_Districts_Democratic_2012_Primary.csv"    
## [151] "Montgomery_Local_Legislative_Districts_Republican_2012_Primary.csv"    
## [152] "Montgomery_Local_Legislative_Districts_2012_General.csv"               
## [153] "Prince_Georges_County_Democratic_2012_Primary.csv"                     
## [154] "Prince_Georges_County_Republican_2012_Primary.csv"                     
## [155] "Prince_Georges_County_2012_General.csv"                                
## [156] "Prince_Georges_By_Precinct_Democratic_2012_Primary.csv"                
## [157] "Prince_Georges_By_Precinct_Republican_2012_Primary.csv"                
## [158] "Prince_Georges_By_Precinct_2012_General.csv"                           
## [159] "Prince_Georges_Local_Legislative_Districts_Democratic_2012_Primary.csv"
## [160] "Prince_Georges_Local_Legislative_Districts_Republican_2012_Primary.csv"
## [161] "Prince_Georges_Local_Legislative_Districts_2012_General.csv"           
## [162] "Queen_Annes_County_Democratic_2012_Primary.csv"                        
## [163] "Queen_Annes_County_Republican_2012_Primary.csv"                        
## [164] "Queen_Annes_Questions_County_2012.csv"                                 
## [165] "Queen_Annes_By_Precinct_Republican_2012_Primary.csv"                   
## [166] "Queen_Annes_By_Precinct_2012_General.csv"                              
## [167] "Queen_Annes_Local_Legislative_Districts_Democratic_2012_Primary.csv"   
## [168] "Queen_Annes_Local_Legislative_Districts_2012_General.csv"              
## [169] "Queen_Annes_Questions_Local_Legislative_Districts_2012.csv"            
## [170] "St._Marys_County_Republican_2012_Primary.csv"                          
## [171] "St._Marys_County_2012_General.csv"                                     
## [172] "St._Marys_Questions_County_2012.csv"                                   
## [173] "St._Marys_By_Precinct_Republican_2012_Primary.csv"                     
## [174] "St._Marys_By_Precinct_2012_General.csv"                                
## [175] "St._Marys_Questions_Precinct_2012.csv"                                 
## [176] "St._Marys_Local_Legislative_Districts_Republican_2012_Primary.csv"     
## [177] "St._Marys_Local_Legislative_Districts_2012_General.csv"                
## [178] "St._Marys_Questions_Local_Legislative_Districts_2012.csv"              
## [179] "Somerset_County_Republican_2012_Primary.csv"                           
## [180] "Somerset_Questions_County_2012.csv"                                    
## [181] "Somerset_By_Precinct_Democratic_2012_Primary.csv"                      
## [182] "Somerset_By_Precinct_2012_General.csv"                                 
## [183] "Somerset_Local_Legislative_Districts_Democratic_2012_Primary.csv"      
## [184] "Somerset_Local_Legislative_Districts_Republican_2012_Primary.csv"      
## [185] "Somerset_Questions_Local_Legislative_Districts_2012.csv"               
## [186] "Talbot_County_Republican_2012_Primary.csv"                             
## [187] "Talbot_County_2012_General.csv"                                        
## [188] "Talbot_By_Precinct_Democratic_2012_Primary.csv"                        
## [189] "Talbot_By_Precinct_2012_General.csv"                                   
## [190] "Talbot_Questions_Precinct_2012.csv"                                    
## [191] "Talbot_Local_Legislative_Districts_Republican_2012_Primary.csv"        
## [192] "Talbot_Questions_Local_Legislative_Districts_2012.csv"                 
## [193] "Washington_County_Democratic_2012_Primary.csv"                         
## [194] "Washington_County_2012_General.csv"                                    
## [195] "Washington_By_Precinct_Democratic_2012_Primary.csv"                    
## [196] "Washington_By_Precinct_Republican_2012_Primary.csv"                    
## [197] "Washington_Questions_Precinct_2012.csv"                                
## [198] "Wicomico_County_Republican_2012_Primary.csv"                           
## [199] "Wicomico_County_2012_General.csv"                                      
## [200] "Wicomico_By_Precinct_Democratic_2012_Primary.csv"                      
## [201] "Wicomico_By_Precinct_2012_General.csv"                                 
## [202] "Wicomico_Questions_Precinct_2012.csv"                                  
## [203] "Wicomico_Local_Legislative_Districts_Republican_2012_Primary.csv"      
## [204] "Wicomico_Questions_Local_Legislative_Districts_2012.csv"               
## [205] "Worcester_County_Democratic_2012_Primary.csv"                          
## [206] "Worcester_County_2012_General.csv"                                     
## [207] "Worcester_By_Precinct_Democratic_2012_Primary.csv"                     
## [208] "Worcester_By_Precinct_Republican_2012_Primary.csv"                     
## [209] "Worcester_Questions_Precinct_2012.csv"                                 
## [210] "Worcester_Local_Legislative_Districts_Republican_2012_Primary.csv"     
## [211] "Worcester_Local_Legislative_Districts_2012_General.csv"                
## [212] "../../../about/index.html"                                             
## [213] "../../../about/county_boards.html"                                     
## [214] "../../../privacy.html"                                                 
## [215] "mailto:info.sbe@maryland.gov"                                          
## [216] "https://twitter.com/md_sbe"                                            
## [217] "http://www.maryland.gov/pages/social_media.aspx"
str_detect(links, "_General.csv")
##   [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
##  [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
##  [25] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
##  [37] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
##  [49]  TRUE FALSE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE FALSE  TRUE FALSE
##  [61] FALSE FALSE FALSE  TRUE FALSE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE
##  [73]  TRUE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE
##  [85]  TRUE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE
##  [97]  TRUE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE
## [109]  TRUE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE
## [121] FALSE  TRUE FALSE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE FALSE  TRUE
## [133] FALSE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE FALSE  TRUE FALSE FALSE
## [145] FALSE  TRUE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE  TRUE FALSE FALSE
## [157] FALSE  TRUE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE  TRUE FALSE FALSE
## [169] FALSE FALSE  TRUE FALSE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE FALSE
## [181]  TRUE FALSE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE FALSE  TRUE FALSE
## [193] FALSE FALSE  TRUE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE  TRUE FALSE
## [205] FALSE FALSE  TRUE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE  TRUE FALSE
## [217] FALSE FALSE FALSE  TRUE FALSE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE
## [229] FALSE  TRUE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE  TRUE FALSE FALSE
## [241] FALSE FALSE  TRUE FALSE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE FALSE
## [253]  TRUE FALSE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE FALSE  TRUE FALSE
## [265] FALSE FALSE FALSE  TRUE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE  TRUE
## [277] FALSE FALSE FALSE  TRUE FALSE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE
## [289] FALSE  TRUE FALSE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE  TRUE FALSE
## [301] FALSE FALSE  TRUE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE  TRUE FALSE
## [313] FALSE FALSE  TRUE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE  TRUE FALSE
## [325] FALSE FALSE  TRUE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE  TRUE FALSE
## [337] FALSE FALSE  TRUE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE  TRUE FALSE
## [349] FALSE FALSE  TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [361] FALSE
unlist(str_extract_all(links, ".+_2012_General\\.csv"))
##  [1] "State_Congressional_Districts_2012_General.csv"             
##  [2] "State_Legislative_Districts_2012_General.csv"               
##  [3] "All_By_Precinct_2012_General.csv"                           
##  [4] "Allegany_County_2012_General.csv"                           
##  [5] "Allegany_By_Precinct_2012_General.csv"                      
##  [6] "Anne_Arundel_County_2012_General.csv"                       
##  [7] "Anne_Arundel_By_Precinct_2012_General.csv"                  
##  [8] "Anne_Arundel_Local_Legislative_Districts_2012_General.csv"  
##  [9] "Baltimore_City_County_2012_General.csv"                     
## [10] "Baltimore_City_By_Precinct_2012_General.csv"                
## [11] "Baltimore_City_Local_Legislative_Districts_2012_General.csv"
## [12] "Baltimore_County_2012_General.csv"                          
## [13] "Baltimore_By_Precinct_2012_General.csv"                     
## [14] "Baltimore_Local_Legislative_Districts_2012_General.csv"     
## [15] "Calvert_County_2012_General.csv"                            
## [16] "Calvert_By_Precinct_2012_General.csv"                       
## [17] "Calvert_Local_Legislative_Districts_2012_General.csv"       
## [18] "Caroline_County_2012_General.csv"                           
## [19] "Caroline_By_Precinct_2012_General.csv"                      
## [20] "Carroll_County_2012_General.csv"                            
## [21] "Carroll_By_Precinct_2012_General.csv"                       
## [22] "Carroll_Local_Legislative_Districts_2012_General.csv"       
## [23] "Cecil_County_2012_General.csv"                              
## [24] "Cecil_By_Precinct_2012_General.csv"                         
## [25] "Cecil_Local_Legislative_Districts_2012_General.csv"         
## [26] "Charles_County_2012_General.csv"                            
## [27] "Charles_By_Precinct_2012_General.csv"                       
## [28] "Charles_Local_Legislative_Districts_2012_General.csv"       
## [29] "Dorchester_County_2012_General.csv"                         
## [30] "Dorchester_By_Precinct_2012_General.csv"                    
## [31] "Dorchester_Local_Legislative_Districts_2012_General.csv"    
## [32] "Frederick_County_2012_General.csv"                          
## [33] "Frederick_By_Precinct_2012_General.csv"                     
## [34] "Garrett_County_2012_General.csv"                            
## [35] "Garrett_By_Precinct_2012_General.csv"                       
## [36] "Garrett_Local_Legislative_Districts_2012_General.csv"       
## [37] "Harford_County_2012_General.csv"                            
## [38] "Harford_By_Precinct_2012_General.csv"                       
## [39] "Harford_Local_Legislative_Districts_2012_General.csv"       
## [40] "Howard_County_2012_General.csv"                             
## [41] "Howard_By_Precinct_2012_General.csv"                        
## [42] "Howard_Local_Legislative_Districts_2012_General.csv"        
## [43] "Kent_County_2012_General.csv"                               
## [44] "Kent_By_Precinct_2012_General.csv"                          
## [45] "Montgomery_County_2012_General.csv"                         
## [46] "Montgomery_By_Precinct_2012_General.csv"                    
## [47] "Montgomery_Local_Legislative_Districts_2012_General.csv"    
## [48] "Prince_Georges_County_2012_General.csv"                     
## [49] "Prince_Georges_By_Precinct_2012_General.csv"                
## [50] "Prince_Georges_Local_Legislative_Districts_2012_General.csv"
## [51] "Queen_Annes_County_2012_General.csv"                        
## [52] "Queen_Annes_By_Precinct_2012_General.csv"                   
## [53] "Queen_Annes_Local_Legislative_Districts_2012_General.csv"   
## [54] "St._Marys_County_2012_General.csv"                          
## [55] "St._Marys_By_Precinct_2012_General.csv"                     
## [56] "St._Marys_Local_Legislative_Districts_2012_General.csv"     
## [57] "Somerset_County_2012_General.csv"                           
## [58] "Somerset_By_Precinct_2012_General.csv"                      
## [59] "Somerset_Local_Legislative_Districts_2012_General.csv"      
## [60] "Talbot_County_2012_General.csv"                             
## [61] "Talbot_By_Precinct_2012_General.csv"                        
## [62] "Talbot_Local_Legislative_Districts_2012_General.csv"        
## [63] "Washington_County_2012_General.csv"                         
## [64] "Washington_By_Precinct_2012_General.csv"                    
## [65] "Wicomico_County_2012_General.csv"                           
## [66] "Wicomico_By_Precinct_2012_General.csv"                      
## [67] "Wicomico_Local_Legislative_Districts_2012_General.csv"      
## [68] "Worcester_County_2012_General.csv"                          
## [69] "Worcester_By_Precinct_2012_General.csv"                     
## [70] "Worcester_Local_Legislative_Districts_2012_General.csv"
filenames <- unlist(str_extract_all(links, ".+_2012_General\\.csv"))
filenames
##  [1] "State_Congressional_Districts_2012_General.csv"             
##  [2] "State_Legislative_Districts_2012_General.csv"               
##  [3] "All_By_Precinct_2012_General.csv"                           
##  [4] "Allegany_County_2012_General.csv"                           
##  [5] "Allegany_By_Precinct_2012_General.csv"                      
##  [6] "Anne_Arundel_County_2012_General.csv"                       
##  [7] "Anne_Arundel_By_Precinct_2012_General.csv"                  
##  [8] "Anne_Arundel_Local_Legislative_Districts_2012_General.csv"  
##  [9] "Baltimore_City_County_2012_General.csv"                     
## [10] "Baltimore_City_By_Precinct_2012_General.csv"                
## [11] "Baltimore_City_Local_Legislative_Districts_2012_General.csv"
## [12] "Baltimore_County_2012_General.csv"                          
## [13] "Baltimore_By_Precinct_2012_General.csv"                     
## [14] "Baltimore_Local_Legislative_Districts_2012_General.csv"     
## [15] "Calvert_County_2012_General.csv"                            
## [16] "Calvert_By_Precinct_2012_General.csv"                       
## [17] "Calvert_Local_Legislative_Districts_2012_General.csv"       
## [18] "Caroline_County_2012_General.csv"                           
## [19] "Caroline_By_Precinct_2012_General.csv"                      
## [20] "Carroll_County_2012_General.csv"                            
## [21] "Carroll_By_Precinct_2012_General.csv"                       
## [22] "Carroll_Local_Legislative_Districts_2012_General.csv"       
## [23] "Cecil_County_2012_General.csv"                              
## [24] "Cecil_By_Precinct_2012_General.csv"                         
## [25] "Cecil_Local_Legislative_Districts_2012_General.csv"         
## [26] "Charles_County_2012_General.csv"                            
## [27] "Charles_By_Precinct_2012_General.csv"                       
## [28] "Charles_Local_Legislative_Districts_2012_General.csv"       
## [29] "Dorchester_County_2012_General.csv"                         
## [30] "Dorchester_By_Precinct_2012_General.csv"                    
## [31] "Dorchester_Local_Legislative_Districts_2012_General.csv"    
## [32] "Frederick_County_2012_General.csv"                          
## [33] "Frederick_By_Precinct_2012_General.csv"                     
## [34] "Garrett_County_2012_General.csv"                            
## [35] "Garrett_By_Precinct_2012_General.csv"                       
## [36] "Garrett_Local_Legislative_Districts_2012_General.csv"       
## [37] "Harford_County_2012_General.csv"                            
## [38] "Harford_By_Precinct_2012_General.csv"                       
## [39] "Harford_Local_Legislative_Districts_2012_General.csv"       
## [40] "Howard_County_2012_General.csv"                             
## [41] "Howard_By_Precinct_2012_General.csv"                        
## [42] "Howard_Local_Legislative_Districts_2012_General.csv"        
## [43] "Kent_County_2012_General.csv"                               
## [44] "Kent_By_Precinct_2012_General.csv"                          
## [45] "Montgomery_County_2012_General.csv"                         
## [46] "Montgomery_By_Precinct_2012_General.csv"                    
## [47] "Montgomery_Local_Legislative_Districts_2012_General.csv"    
## [48] "Prince_Georges_County_2012_General.csv"                     
## [49] "Prince_Georges_By_Precinct_2012_General.csv"                
## [50] "Prince_Georges_Local_Legislative_Districts_2012_General.csv"
## [51] "Queen_Annes_County_2012_General.csv"                        
## [52] "Queen_Annes_By_Precinct_2012_General.csv"                   
## [53] "Queen_Annes_Local_Legislative_Districts_2012_General.csv"   
## [54] "St._Marys_County_2012_General.csv"                          
## [55] "St._Marys_By_Precinct_2012_General.csv"                     
## [56] "St._Marys_Local_Legislative_Districts_2012_General.csv"     
## [57] "Somerset_County_2012_General.csv"                           
## [58] "Somerset_By_Precinct_2012_General.csv"                      
## [59] "Somerset_Local_Legislative_Districts_2012_General.csv"      
## [60] "Talbot_County_2012_General.csv"                             
## [61] "Talbot_By_Precinct_2012_General.csv"                        
## [62] "Talbot_Local_Legislative_Districts_2012_General.csv"        
## [63] "Washington_County_2012_General.csv"                         
## [64] "Washington_By_Precinct_2012_General.csv"                    
## [65] "Wicomico_County_2012_General.csv"                           
## [66] "Wicomico_By_Precinct_2012_General.csv"                      
## [67] "Wicomico_Local_Legislative_Districts_2012_General.csv"      
## [68] "Worcester_County_2012_General.csv"                          
## [69] "Worcester_By_Precinct_2012_General.csv"                     
## [70] "Worcester_Local_Legislative_Districts_2012_General.csv"
filenames_list <- as.list(filenames)
filenames_list[1:3]
## [[1]]
## [1] "State_Congressional_Districts_2012_General.csv"
## 
## [[2]]
## [1] "State_Legislative_Districts_2012_General.csv"
## 
## [[3]]
## [1] "All_By_Precinct_2012_General.csv"
  1. Construct a download function
add_two <- function(x){
  y <- x + 2
  return(y)
}

add_two(5)
## [1] 7
?dir.create
?str_c
?file.exists
?download.file
?Sys.sleep

baseurl = "https://elections.maryland.gov/elections/2012/election_data/"
filenames[1]
## [1] "State_Congressional_Districts_2012_General.csv"
str_c(baseurl, filenames[3], collapse="")
## [1] "https://elections.maryland.gov/elections/2012/election_data/All_By_Precinct_2012_General.csv"
downloadCSV <- function(filename, baseurl, folder){
  dir.create(folder, showWarnings = FALSE)
  fileurl <- str_c(baseurl, filename)
  if (!file.exists(str_c(folder, "/", filename))) {
    download.file(fileurl,
                  destfile = str_c(folder, "/", filename))
    Sys.sleep(1)
  }
}

https://elections.maryland.gov/elections/2012/election_data/State_Legislative_Districts_2012_General.csv

  1. Execute the downloads
library(future.apply)
## Loading required package: future
plan(multicore)

future_lapply(filenames_list, downloadCSV,
      baseurl = "https://elections.maryland.gov/elections/2012/election_data/",
      folder = "elec12_maryland")
## [[1]]
## NULL
## 
## [[2]]
## NULL
## 
## [[3]]
## NULL
## 
## [[4]]
## NULL
## 
## [[5]]
## NULL
## 
## [[6]]
## NULL
## 
## [[7]]
## NULL
## 
## [[8]]
## NULL
## 
## [[9]]
## NULL
## 
## [[10]]
## NULL
## 
## [[11]]
## NULL
## 
## [[12]]
## NULL
## 
## [[13]]
## NULL
## 
## [[14]]
## NULL
## 
## [[15]]
## NULL
## 
## [[16]]
## NULL
## 
## [[17]]
## NULL
## 
## [[18]]
## NULL
## 
## [[19]]
## NULL
## 
## [[20]]
## NULL
## 
## [[21]]
## NULL
## 
## [[22]]
## NULL
## 
## [[23]]
## NULL
## 
## [[24]]
## NULL
## 
## [[25]]
## NULL
## 
## [[26]]
## NULL
## 
## [[27]]
## NULL
## 
## [[28]]
## NULL
## 
## [[29]]
## NULL
## 
## [[30]]
## NULL
## 
## [[31]]
## NULL
## 
## [[32]]
## NULL
## 
## [[33]]
## NULL
## 
## [[34]]
## NULL
## 
## [[35]]
## NULL
## 
## [[36]]
## NULL
## 
## [[37]]
## NULL
## 
## [[38]]
## NULL
## 
## [[39]]
## NULL
## 
## [[40]]
## NULL
## 
## [[41]]
## NULL
## 
## [[42]]
## NULL
## 
## [[43]]
## NULL
## 
## [[44]]
## NULL
## 
## [[45]]
## NULL
## 
## [[46]]
## NULL
## 
## [[47]]
## NULL
## 
## [[48]]
## NULL
## 
## [[49]]
## NULL
## 
## [[50]]
## NULL
## 
## [[51]]
## NULL
## 
## [[52]]
## NULL
## 
## [[53]]
## NULL
## 
## [[54]]
## NULL
## 
## [[55]]
## NULL
## 
## [[56]]
## NULL
## 
## [[57]]
## NULL
## 
## [[58]]
## NULL
## 
## [[59]]
## NULL
## 
## [[60]]
## NULL
## 
## [[61]]
## NULL
## 
## [[62]]
## NULL
## 
## [[63]]
## NULL
## 
## [[64]]
## NULL
## 
## [[65]]
## NULL
## 
## [[66]]
## NULL
## 
## [[67]]
## NULL
## 
## [[68]]
## NULL
## 
## [[69]]
## NULL
## 
## [[70]]
## NULL
getwd()
## [1] "C:/Users/CAU/Dropbox/2020_Class/fall/big data methodology/R"
list.files(str_c(getwd(),"/elec12_maryland"))
##  [1] "All_By_Precinct_2012_General.csv"                           
##  [2] "Allegany_By_Precinct_2012_General.csv"                      
##  [3] "Allegany_County_2012_General.csv"                           
##  [4] "Anne_Arundel_By_Precinct_2012_General.csv"                  
##  [5] "Anne_Arundel_County_2012_General.csv"                       
##  [6] "Anne_Arundel_Local_Legislative_Districts_2012_General.csv"  
##  [7] "Baltimore_By_Precinct_2012_General.csv"                     
##  [8] "Baltimore_City_By_Precinct_2012_General.csv"                
##  [9] "Baltimore_City_County_2012_General.csv"                     
## [10] "Baltimore_City_Local_Legislative_Districts_2012_General.csv"
## [11] "Baltimore_County_2012_General.csv"                          
## [12] "Baltimore_Local_Legislative_Districts_2012_General.csv"     
## [13] "Calvert_By_Precinct_2012_General.csv"                       
## [14] "Calvert_County_2012_General.csv"                            
## [15] "Calvert_Local_Legislative_Districts_2012_General.csv"       
## [16] "Caroline_By_Precinct_2012_General.csv"                      
## [17] "Caroline_County_2012_General.csv"                           
## [18] "Carroll_By_Precinct_2012_General.csv"                       
## [19] "Carroll_County_2012_General.csv"                            
## [20] "Carroll_Local_Legislative_Districts_2012_General.csv"       
## [21] "Cecil_By_Precinct_2012_General.csv"                         
## [22] "Cecil_County_2012_General.csv"                              
## [23] "Cecil_Local_Legislative_Districts_2012_General.csv"         
## [24] "Charles_By_Precinct_2012_General.csv"                       
## [25] "Charles_County_2012_General.csv"                            
## [26] "Charles_Local_Legislative_Districts_2012_General.csv"       
## [27] "Dorchester_By_Precinct_2012_General.csv"                    
## [28] "Dorchester_County_2012_General.csv"                         
## [29] "Dorchester_Local_Legislative_Districts_2012_General.csv"    
## [30] "Frederick_By_Precinct_2012_General.csv"                     
## [31] "Frederick_County_2012_General.csv"                          
## [32] "Garrett_By_Precinct_2012_General.csv"                       
## [33] "Garrett_County_2012_General.csv"                            
## [34] "Garrett_Local_Legislative_Districts_2012_General.csv"       
## [35] "Harford_By_Precinct_2012_General.csv"                       
## [36] "Harford_County_2012_General.csv"                            
## [37] "Harford_Local_Legislative_Districts_2012_General.csv"       
## [38] "Howard_By_Precinct_2012_General.csv"                        
## [39] "Howard_County_2012_General.csv"                             
## [40] "Howard_Local_Legislative_Districts_2012_General.csv"        
## [41] "Kent_By_Precinct_2012_General.csv"                          
## [42] "Kent_County_2012_General.csv"                               
## [43] "Montgomery_By_Precinct_2012_General.csv"                    
## [44] "Montgomery_County_2012_General.csv"                         
## [45] "Montgomery_Local_Legislative_Districts_2012_General.csv"    
## [46] "Prince_Georges_By_Precinct_2012_General.csv"                
## [47] "Prince_Georges_County_2012_General.csv"                     
## [48] "Prince_Georges_Local_Legislative_Districts_2012_General.csv"
## [49] "Queen_Annes_By_Precinct_2012_General.csv"                   
## [50] "Queen_Annes_County_2012_General.csv"                        
## [51] "Queen_Annes_Local_Legislative_Districts_2012_General.csv"   
## [52] "Somerset_By_Precinct_2012_General.csv"                      
## [53] "Somerset_County_2012_General.csv"                           
## [54] "Somerset_Local_Legislative_Districts_2012_General.csv"      
## [55] "St._Marys_By_Precinct_2012_General.csv"                     
## [56] "St._Marys_County_2012_General.csv"                          
## [57] "St._Marys_Local_Legislative_Districts_2012_General.csv"     
## [58] "State_Congressional_Districts_2012_General.csv"             
## [59] "State_Legislative_Districts_2012_General.csv"               
## [60] "Talbot_By_Precinct_2012_General.csv"                        
## [61] "Talbot_County_2012_General.csv"                             
## [62] "Talbot_Local_Legislative_Districts_2012_General.csv"        
## [63] "Washington_By_Precinct_2012_General.csv"                    
## [64] "Washington_County_2012_General.csv"                         
## [65] "Wicomico_By_Precinct_2012_General.csv"                      
## [66] "Wicomico_County_2012_General.csv"                           
## [67] "Wicomico_Local_Legislative_Districts_2012_General.csv"      
## [68] "Worcester_By_Precinct_2012_General.csv"                     
## [69] "Worcester_County_2012_General.csv"                          
## [70] "Worcester_Local_Legislative_Districts_2012_General.csv"
length(list.files(str_c(getwd(),"/elec12_maryland")))
## [1] 70

Manipulating URLs to access multiple pages

  1. Identify the running mechanism in the URL syntax

  2. Retrieve links to the running pages

  3. Download the running pages

  4. Retrieve links to the entries on the running pages

  5. Download the single entries

library(xml2)
base_url <- "https://news.naver.com/main/list.nhn?mode=LSD&mid=sec&sid1=001&date=20201028&page=1"
page <- xml2::read_html(base_url)
page_parsed <- htmlParse(page)

News links

‘//[@id="main_content"]/div[2]/ul[1]/li[1]/dl/dt[2]/a’ ’//[@id="main_content"]/div[2]/ul[1]/li[2]/dl/dt[2]/a’

’//*[@id="main_content"]/div[2]/ul[1]/li/dl/dt[2]/a’

’//[@id="main_content"]/div[2]//*/dl/dt[2]/a’

‘//[@id="main_content"]/div[2]/ul[1]/li[1]/dl/dt[2]/a’ ’//[@id="main_content"]/div[2]/ul[1]/li[2]/dl/dt[2]/a’ ‘//[@id="main_content"]/div[2]/ul[1]/li[3]/dl/dt[2]/a’ … ’//[@id="main_content"]/div[2]/ul[2]/li[10]/dl/dt[2]/a’

links <- xpathSApply(page_parsed, '//*[@id="main_content"]/div[2]/*/*/dl/dt[2]/a', xmlGetAttr, "href")

https://news.naver.com/main/list.nhn?mode=LSD&mid=sec&sid1=001&date=20201027&page=1 https://news.naver.com/main/list.nhn?mode=LSD&mid=sec&sid1=001&date=20201027&page=2

//*[@id="main_content"]/div[3]/strong

url_before <- "https://news.naver.com/main/list.nhn?mode=LSD&mid=sec&sid1=001&date=20201028&page="

all_links <- c()

for(p in 1:10){
  url <- str_c(url_before, p)
  print(url)
}
## [1] "https://news.naver.com/main/list.nhn?mode=LSD&mid=sec&sid1=001&date=20201028&page=1"
## [1] "https://news.naver.com/main/list.nhn?mode=LSD&mid=sec&sid1=001&date=20201028&page=2"
## [1] "https://news.naver.com/main/list.nhn?mode=LSD&mid=sec&sid1=001&date=20201028&page=3"
## [1] "https://news.naver.com/main/list.nhn?mode=LSD&mid=sec&sid1=001&date=20201028&page=4"
## [1] "https://news.naver.com/main/list.nhn?mode=LSD&mid=sec&sid1=001&date=20201028&page=5"
## [1] "https://news.naver.com/main/list.nhn?mode=LSD&mid=sec&sid1=001&date=20201028&page=6"
## [1] "https://news.naver.com/main/list.nhn?mode=LSD&mid=sec&sid1=001&date=20201028&page=7"
## [1] "https://news.naver.com/main/list.nhn?mode=LSD&mid=sec&sid1=001&date=20201028&page=8"
## [1] "https://news.naver.com/main/list.nhn?mode=LSD&mid=sec&sid1=001&date=20201028&page=9"
## [1] "https://news.naver.com/main/list.nhn?mode=LSD&mid=sec&sid1=001&date=20201028&page=10"
for(p in 1:10){
  url <- str_c(url_before, p)
  page <- read_html(url)
  page_parsed <- htmlParse(page)
  links <- xpathSApply(page_parsed, '//*[@id="main_content"]/div[2]/*/*/dl/dt[2]/a', xmlGetAttr, "href")
  if(length(links) < 10){break}
  all_links <- c(all_links, links)
  print(p)
}
## [1] 1
## [1] 2
## [1] 3
## [1] 4
## [1] 5
## [1] 6
## [1] 7
## [1] 8
## [1] 9
## [1] 10
length(all_links)
## [1] 182
all_links[1:10]
##  [1] "https://news.naver.com/main/read.nhn?mode=LSD&mid=sec&sid1=001&oid=469&aid=0000548669"
##  [2] "https://news.naver.com/main/read.nhn?mode=LSD&mid=sec&sid1=001&oid=028&aid=0002518057"
##  [3] "https://news.naver.com/main/read.nhn?mode=LSD&mid=sec&sid1=001&oid=056&aid=0010924621"
##  [4] "https://news.naver.com/main/read.nhn?mode=LSD&mid=sec&sid1=001&oid=119&aid=0002438852"
##  [5] "https://news.naver.com/main/read.nhn?mode=LSD&mid=sec&sid1=001&oid=057&aid=0001513556"
##  [6] "https://news.naver.com/main/read.nhn?mode=LSD&mid=sec&sid1=001&oid=092&aid=0002203301"
##  [7] "https://news.naver.com/main/read.nhn?mode=LSD&mid=sec&sid1=001&oid=056&aid=0010924620"
##  [8] "https://news.naver.com/main/read.nhn?mode=LSD&mid=sec&sid1=001&oid=449&aid=0000199585"
##  [9] "https://news.naver.com/main/read.nhn?mode=LSD&mid=sec&sid1=001&oid=056&aid=0010924619"
## [10] "https://news.naver.com/main/read.nhn?mode=LSD&mid=sec&sid1=001&oid=082&aid=0001038949"

Check XPath

library(rvest)
## 
## Attaching package: 'rvest'
## The following object is masked from 'package:XML':
## 
##     xml
all_links[1]
## [1] "https://news.naver.com/main/read.nhn?mode=LSD&mid=sec&sid1=001&oid=469&aid=0000548669"
page <- read_html(all_links[1])
page_parsed <- htmlParse(page)

#Headline
xpathSApply(page_parsed, '//*[@id="articleTitle"]', fun = xmlValue)
## [1] "주호영 이례적 몸수색...靑 \"규정 따른 것, 융통성은 아쉽다\""
#Company
xpathSApply(page_parsed, '//*[@id="main_content"]/div[1]/div[1]/a/img', xmlGetAttr, "title") %>% repair_encoding(from="UTF-8")
## [1] "한국일보"
#Time
xpathSApply(page_parsed, '//*[@id="main_content"]/div[1]/div[3]/div/span', xmlValue) %>% str_c(collapse=" ") %>% str_squish()
## [1] "2020.10.28. 오후 7:46"
#Body content
xpathSApply(page_parsed, '//*[@id="articleBodyContents"]/text()', xmlValue) %>% str_c(collapse=" ") %>% str_squish()
## [1] "문재인 대통령의 28일 국회 시정연설에 앞서 대통령 경호처가 제1야당 원내 사령탑인 주호영 원내대표의 몸을 수색한 것이 거센 후폭풍을 낳았다. 국민의힘은 '의도된 도발'로 규정하며 강하게 항의했고, 박병석 국회의장은 입법부 수장으로서 청와대에 유감을 표했다. 청와대는 '경호업무지침'에 따랐다'며 사과하지 않았다. 융통성을 발휘하지 못한 점에 대해서만 경호처가 유감을 밝혔다. 주 원내대표는 이날 오전 문 대통령의 시정연설 전 요인 간담회가 열린 국회의장실로 향했다. 국회 로텐더홀에서 열린 '라임·옵티머스' 특검을 촉구하는 결의 대회에 참석하느라 다른 인사들보다 조금 늦었다. 정부·여당의 특검 거부에 항의하는 뜻으로 김종인 국민의힘 비상대책위원장이 간담회에 불참한 터라, 주 원내대표는 사실상 국민의힘 대표 자격이었다. 의장실 앞에서 주 원내대표는 대통령 경호원들에게 \"야당 원내대표\"라고 알렸다. 그러나 경호원들은 주 원내대표를 통과시키지 않고 신체를 수색하겠다고 했다. 이에 \"수색 당할 수 없다\"며 돌아섰다는 게 주 원내대표 설명이다. 국민의힘은 \"의도성이 짙다\"고 반발했다. 주 원내대표는 의원총회에서 \"경호부장이 직원 실수라고 사과했지만, 실수일 리 없다\"며 \"저의 입장을 막기 위한 의도된 도발인지 조금 더 챙겨봐야겠다\"고 주장했다. 김태년 더불어민주당 원내대표는 신체 수색을 받지 않은 것으로 알려졌다. 국민의힘은 당시 상황을 확인하기 위해 의장실 앞 폐쇄회로(CC)TV를 영상을 확인했지만, 사각지대에서 벌어진 일이라 기록이 남아있지 않았다. 주 원내대표는 박병석 의장을 찾아가 대통령 경호처 책임을 가려 줄 것을 요구했다. 박 의장은 \"국회 안에서 일어난 일이기 때문에 정말 미안하다\"며 위로의 뜻을 전했다고 한다. 논란이 커지자 경호처는 입장문을 내고 \"정당 원내대표는 검색 면제 대상이 아니다\"고 일축했다. '경호처업무지침'엔 여야 정당 대표만 신원 수색 예외로 규정돼 있고, 여야 대표와 동반하는 당직자도 수색을 면제하는 것이 관례인 것으로 알려진다. 경호처는 \"주 원내대표는 문 대통령과 5부 요인, 여야 정당 대표 등이 모두 입장을 완료한 뒤 홀로 환담장에 도착했다\"고 설명했다. 엄밀히 따지면 주 원내대표가 면제 대상이 아니었다는 뜻이다. 경호처는 \"현장 경호 검색요원이 융통성을 발휘했으면 좋았을 것\"이라는 메시지를 덧붙였을 뿐, 청와대 차원의 공식 사과는 없었다. 이혜미 기자 herstory@hankookilbo.com"

Build customized function

headline_extractor <- function(x){
  page <- read_html(x)
  page_parsed <- htmlParse(page)
  headline <- xpathSApply(page_parsed, '//*[@id="articleTitle"]', fun = xmlValue)
  headline <- repair_encoding(headline, from="UTF-8")
  return(headline)
}

headline_extractor(all_links[1])
## [1] "주호영 이례적 몸수색...靑 \"규정 따른 것, 융통성은 아쉽다\""
company_extractor <- function(x){
  page <- read_html(x)
  page_parsed <- htmlParse(page)
  company <- xpathSApply(page_parsed, '//*[@id="main_content"]/div[1]/div[1]/a/img', xmlGetAttr, "title")
  company <- repair_encoding(company, from="UTF-8")
  return(company)
}

company_extractor(all_links[1])
## [1] "한국일보"
time_extractor <- function(x){
  page <- read_html(x)
  page_parsed <- htmlParse(page)
  time <- xpathSApply(page_parsed, '//*[@id="main_content"]/div[1]/div[3]/div/span', xmlValue) %>% 
    str_c(collapse=" ") %>% str_squish()
  time <- repair_encoding(time, from="UTF-8")
  return(time)
}

content_extractor <- function(x){
  page <- read_html(x)
  page_parsed <- htmlParse(page)
  content <- xpathSApply(page_parsed, '//*[@id="articleBodyContents"]/text()', xmlValue) %>% 
    str_c(collapse=" ") %>% str_squish()
  content <- repair_encoding(content, from="UTF-8")
  return(content)
}

Apply functions over data frame

library(tidyverse)
## -- Attaching packages ------------------------------------------------------------ tidyverse 1.3.0 --
## √ ggplot2 3.3.0     √ purrr   0.3.4
## √ tibble  3.0.0     √ dplyr   1.0.1
## √ tidyr   1.0.2     √ forcats 0.5.0
## √ readr   1.3.1
## -- Conflicts --------------------------------------------------------------- tidyverse_conflicts() --
## x tidyr::complete()       masks RCurl::complete()
## x dplyr::filter()         masks stats::filter()
## x readr::guess_encoding() masks rvest::guess_encoding()
## x dplyr::lag()            masks stats::lag()
## x purrr::pluck()          masks rvest::pluck()
## x rvest::xml()            masks XML::xml()
news_df <- tibble(url = all_links)

dim(news_df)
## [1] 182   1
library(future.apply)
plan(multicore)
news_df <- news_df %>%
  mutate(headline = future_sapply(url, headline_extractor),
         company = future_sapply(url, company_extractor),
         time = future_sapply(url, time_extractor),
         content = future_sapply(url, content_extractor))
## Warning: Problem with `mutate()` input `headline`.
## x the Unicode codepoint \U000000a0 cannot be converted to destination encoding
## i Input `headline` is `future_sapply(url, headline_extractor)`.
## Warning in stringi::stri_conv(x, from = from): the Unicode codepoint \U000000a0
## cannot be converted to destination encoding
## Warning: Problem with `mutate()` input `headline`.
## x the Unicode codepoint \U00002027 cannot be converted to destination encoding
## i Input `headline` is `future_sapply(url, headline_extractor)`.
## Warning in stringi::stri_conv(x, from = from): the Unicode codepoint \U00002027
## cannot be converted to destination encoding
## Warning: Problem with `mutate()` input `content`.
## x the Unicode codepoint \U000000a9 cannot be converted to destination encoding
## i Input `content` is `future_sapply(url, content_extractor)`.
## Warning in stringi::stri_conv(x, from = from): the Unicode codepoint \U000000a9
## cannot be converted to destination encoding
## Warning: Problem with `mutate()` input `content`.
## x the Unicode codepoint \U000000a9 cannot be converted to destination encoding
## i Input `content` is `future_sapply(url, content_extractor)`.
## Warning in stringi::stri_conv(x, from = from): the Unicode codepoint \U000000a9
## cannot be converted to destination encoding
## Warning: Problem with `mutate()` input `content`.
## x the Unicode codepoint \U00002014 cannot be converted to destination encoding
## i Input `content` is `future_sapply(url, content_extractor)`.
## Warning in stringi::stri_conv(x, from = from): the Unicode codepoint \U00002014
## cannot be converted to destination encoding
## Warning: Problem with `mutate()` input `content`.
## x the Unicode codepoint \U000000a9 cannot be converted to destination encoding
## i Input `content` is `future_sapply(url, content_extractor)`.
## Warning in stringi::stri_conv(x, from = from): the Unicode codepoint \U000000a9
## cannot be converted to destination encoding
## Warning: Problem with `mutate()` input `content`.
## x the Unicode codepoint \U00002014 cannot be converted to destination encoding
## i Input `content` is `future_sapply(url, content_extractor)`.
## Warning in stringi::stri_conv(x, from = from): the Unicode codepoint \U00002014
## cannot be converted to destination encoding
## Warning: Problem with `mutate()` input `content`.
## x the Unicode codepoint \U000000a9 cannot be converted to destination encoding
## i Input `content` is `future_sapply(url, content_extractor)`.
## Warning in stringi::stri_conv(x, from = from): the Unicode codepoint \U000000a9
## cannot be converted to destination encoding
## Warning: Problem with `mutate()` input `content`.
## x the Unicode codepoint \U000000a9 cannot be converted to destination encoding
## i Input `content` is `future_sapply(url, content_extractor)`.
## Warning in stringi::stri_conv(x, from = from): the Unicode codepoint \U000000a9
## cannot be converted to destination encoding
## Warning: Problem with `mutate()` input `content`.
## x the Unicode codepoint \U000000a9 cannot be converted to destination encoding
## i Input `content` is `future_sapply(url, content_extractor)`.
## Warning in stringi::stri_conv(x, from = from): the Unicode codepoint \U000000a9
## cannot be converted to destination encoding
## Warning: Problem with `mutate()` input `content`.
## x the Unicode codepoint \U00002014 cannot be converted to destination encoding
## i Input `content` is `future_sapply(url, content_extractor)`.
## Warning in stringi::stri_conv(x, from = from): the Unicode codepoint \U00002014
## cannot be converted to destination encoding
## Warning: Problem with `mutate()` input `content`.
## x the Unicode codepoint \U00002014 cannot be converted to destination encoding
## i Input `content` is `future_sapply(url, content_extractor)`.
## Warning in stringi::stri_conv(x, from = from): the Unicode codepoint \U00002014
## cannot be converted to destination encoding
## Warning: Problem with `mutate()` input `content`.
## x the Unicode codepoint \U00002014 cannot be converted to destination encoding
## i Input `content` is `future_sapply(url, content_extractor)`.
## Warning in stringi::stri_conv(x, from = from): the Unicode codepoint \U00002014
## cannot be converted to destination encoding
## Warning: Problem with `mutate()` input `content`.
## x the Unicode codepoint \U00002014 cannot be converted to destination encoding
## i Input `content` is `future_sapply(url, content_extractor)`.
## Warning in stringi::stri_conv(x, from = from): the Unicode codepoint \U00002014
## cannot be converted to destination encoding
## Warning: Problem with `mutate()` input `content`.
## x the Unicode codepoint \U00002014 cannot be converted to destination encoding
## i Input `content` is `future_sapply(url, content_extractor)`.
## Warning in stringi::stri_conv(x, from = from): the Unicode codepoint \U00002014
## cannot be converted to destination encoding
## Warning: Problem with `mutate()` input `content`.
## x the Unicode codepoint \U00002014 cannot be converted to destination encoding
## i Input `content` is `future_sapply(url, content_extractor)`.
## Warning in stringi::stri_conv(x, from = from): the Unicode codepoint \U00002014
## cannot be converted to destination encoding
## Warning: Problem with `mutate()` input `content`.
## x the Unicode codepoint \U00002014 cannot be converted to destination encoding
## i Input `content` is `future_sapply(url, content_extractor)`.
## Warning in stringi::stri_conv(x, from = from): the Unicode codepoint \U00002014
## cannot be converted to destination encoding
## Warning: Problem with `mutate()` input `content`.
## x the Unicode codepoint \U00002014 cannot be converted to destination encoding
## i Input `content` is `future_sapply(url, content_extractor)`.
## Warning in stringi::stri_conv(x, from = from): the Unicode codepoint \U00002014
## cannot be converted to destination encoding
## Warning: Problem with `mutate()` input `content`.
## x the Unicode codepoint \U00002014 cannot be converted to destination encoding
## i Input `content` is `future_sapply(url, content_extractor)`.
## Warning in stringi::stri_conv(x, from = from): the Unicode codepoint \U00002014
## cannot be converted to destination encoding
## Warning: Problem with `mutate()` input `content`.
## x the Unicode codepoint \U00002014 cannot be converted to destination encoding
## i Input `content` is `future_sapply(url, content_extractor)`.
## Warning in stringi::stri_conv(x, from = from): the Unicode codepoint \U00002014
## cannot be converted to destination encoding
## Warning: Problem with `mutate()` input `content`.
## x the Unicode codepoint \U00002014 cannot be converted to destination encoding
## i Input `content` is `future_sapply(url, content_extractor)`.
## Warning in stringi::stri_conv(x, from = from): the Unicode codepoint \U00002014
## cannot be converted to destination encoding
## Warning: Problem with `mutate()` input `content`.
## x the Unicode codepoint \U00002014 cannot be converted to destination encoding
## i Input `content` is `future_sapply(url, content_extractor)`.
## Warning in stringi::stri_conv(x, from = from): the Unicode codepoint \U00002014
## cannot be converted to destination encoding
## Warning: Problem with `mutate()` input `content`.
## x the Unicode codepoint \U000000a9 cannot be converted to destination encoding
## i Input `content` is `future_sapply(url, content_extractor)`.
## Warning in stringi::stri_conv(x, from = from): the Unicode codepoint \U000000a9
## cannot be converted to destination encoding
## Warning: Problem with `mutate()` input `content`.
## x the Unicode codepoint \U000000a9 cannot be converted to destination encoding
## i Input `content` is `future_sapply(url, content_extractor)`.
## Warning in stringi::stri_conv(x, from = from): the Unicode codepoint \U000000a9
## cannot be converted to destination encoding
## Warning: Problem with `mutate()` input `content`.
## x the Unicode codepoint \U00002027 cannot be converted to destination encoding
## i Input `content` is `future_sapply(url, content_extractor)`.
## Warning in stringi::stri_conv(x, from = from): the Unicode codepoint \U00002027
## cannot be converted to destination encoding
## Warning: Problem with `mutate()` input `content`.
## x the Unicode codepoint \U00002027 cannot be converted to destination encoding
## i Input `content` is `future_sapply(url, content_extractor)`.
## Warning in stringi::stri_conv(x, from = from): the Unicode codepoint \U00002027
## cannot be converted to destination encoding
## Warning: Problem with `mutate()` input `content`.
## x the Unicode codepoint \U000000a9 cannot be converted to destination encoding
## i Input `content` is `future_sapply(url, content_extractor)`.
## Warning in stringi::stri_conv(x, from = from): the Unicode codepoint \U000000a9
## cannot be converted to destination encoding
## Warning: Problem with `mutate()` input `content`.
## x the Unicode codepoint \U000000a9 cannot be converted to destination encoding
## i Input `content` is `future_sapply(url, content_extractor)`.
## Warning in stringi::stri_conv(x, from = from): the Unicode codepoint \U000000a9
## cannot be converted to destination encoding
news_df[1:10,]  
## # A tibble: 10 x 5
##    url                 headline            company  time    content             
##    <chr>               <chr>               <chr>    <chr>   <chr>               
##  1 https://news.naver~ "주호영 이례적 몸수색...靑 \~ 한국일보 2020.1~ "문재인 대통령의 28일 국회 시정~
##  2 https://news.naver~ "10월 29일 한겨레 그림판"~ 한겨레   2020.1~ "권범철 기자 kartoon@han~
##  3 https://news.naver~ "[국회의원 6개월 점검] 법안 ~ KBS      2020.1~ "[KBS 제주] [앵커] 21대 ~
##  4 https://news.naver~ "[내일날씨] '기온 뚝'…올가을~ 데일리안 2020.1~ "목요일인 29일은 아침 기온이 5~
##  5 https://news.naver~ "문 대통령 \"전세시장 기필코 ~ MBN      2020.1~ "【 앵커멘트 】 문재인 대통령은 ~
##  6 https://news.naver~ "수협은행 첫 내부출신 은행장..~ ZDNet K~ 2020.1~ "(지디넷코리아=손예술 기자)수협은~
##  7 https://news.naver~ "[긴추린 소식] 민병희 “강원 ~ KBS      2020.1~ "[KBS 춘천] 최근 경기도교육청~
##  8 https://news.naver~ "동두천서 불길 잡다 굴뚝 ‘와르~ 채널A    2020.1~ "경기도의 쓰레기 처리시설에서 큰 ~
##  9 https://news.naver~ "춘천-가평, 첫 ‘광역관광특구’~ KBS      2020.1~ "[KBS 춘천] [앵커] 춘천시와~
## 10 https://news.naver~ "'2020 대중문화예술상' 변희~ 부산일보 2020.1~ "대중문화예술 분야 최고 권위의 정~
dim(news_df)
## [1] 182   5
news_df$time[6]
## https://news.naver.com/main/read.nhn?mode=LSD&mid=sec&sid1=001&oid=092&aid=0002203301 
##                                                               "2020.10.28. 오후 7:46"

Expand over multiple dates

https://news.naver.com/main/list.nhn?mode=LSD&mid=sec&sid1=001&date=20201027&page=1 https://news.naver.com/main/list.nhn?mode=LSD&mid=sec&sid1=001&date=20201026&page=1https://news.naver.com/main/list.nhn?mode=LSD&mid=sec&sid1=001&date=20201001&page=1

date <- seq(from=20201027,to=20201001,by=-1) 
date
##  [1] 20201027 20201026 20201025 20201024 20201023 20201022 20201021 20201020
##  [9] 20201019 20201018 20201017 20201016 20201015 20201014 20201013 20201012
## [17] 20201011 20201010 20201009 20201008 20201007 20201006 20201005 20201004
## [25] 20201003 20201002 20201001
links_extractor <- function(x){
      all_links <- c()
      for(p in 1:10){
        url <- str_c(base_url, "&date=", x, "&page=", p)
        page <- read_html(url)
        page_parsed <- htmlParse(page)
        links <- xpathSApply(page_parsed, '//*[@id="main_content"]/div[2]/*/*/dl/dt[2]/a', xmlGetAttr, "href")
        if(length(links) < 10){break}
        all_links <- c(all_links, links)
      }
      return(all_links)
}

links_list <- future_sapply(date, links_extractor)

length(links_list)
## [1] 27
links_list[[1]]
## NULL
links_list[[2]]
## NULL

Combining into a data frame

#all_news_df <- tibble(url = unlist(links_list))
# 
# all_news_df <- all_news_df %>%
#   mutate(headline = future_sapply(url, headline_extractor),
#          company = future_sapply(url, company_extractor),
#          time = future_sapply(url, time_extractor),
#          content = future_sapply(url, content_extractor))
#   
# all_news_df