It's only happen when I use the headless mode.
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument('--headless')
driver = webdriver.Chrome(
r'C:\Users\Usuario\Downloads\chromedriver.exe',
chrome_options=options,
)
driver.get('https://www.windguru.cz/3640')
html = driver.page_source
driver.quit()
# Result
# html = <html xmlns="http://www.w3.org/1999/xhtml"><head></head><body></body></html>
What is happening?
You were almost there. You simply need to induce WebDriverWait for the desired element to be visible and you can use the following solution:
Code Block:
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
options = webdriver.ChromeOptions()
options.add_argument('--headless')
options.add_argument("start-maximized")
options.add_argument("disable-infobars")
options.add_argument("--disable-extensions")
driver = webdriver.Chrome(chrome_options=options, executable_path=r'C:\Utility\BrowserDrivers\chromedriver.exe')
driver.get('https://www.windguru.cz/3640')
WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.CSS_SELECTOR, "#forecasts-page")))
print(driver.page_source)
driver.quit()
Console Output:
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" class=" no-flash svg no-hiddenscroll no-touchevents hairline no-hires indexeddb" style=""><head>
<title>Windguru - Argentina - Mar del Plata</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Robots" content="index,follow" />
<link rel="manifest" href="/manifest.json" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="application-name" content="Windguru" />
<meta name="apple-mobile-web-app-title" content="Windguru" />
<meta name="msapplication-navbutton-color" content="#333333" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="apple-mobile-web-app-title" content="Windguru" />
<meta name="msapplication-starturl" content="/" />
<meta name="theme-color" content="#333333" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<link rel="icon" type="image/png" sizes="192x192" href="/img/windguru-icon-192x192.png" />
<link rel="apple-touch-icon" type="image/png" sizes="192x192" href="/img/windguru-icon-192x192.png" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=1" /><meta name="description" content="Windguru weather forecast for Argentina - Mar del Plata. Special wind and weather forecast for windsurfing, kitesurfing and other wind related sports." />
<meta name="keywords" content="wind forecast, live wind, windsurfing, kitesurfing, kiteboarding, surfing, snowkiting, sailing, paragliding, wave, meteorology, numeric model, wind speed, GFS, WRF, NWW3, ICON, NAM, HRW, WAM, COSMO, GWAM, EWAM, weather stations, wind stations, forecast maps, Argentina - Mar del Plata" />
<meta name="google-signin-client_id" content="902500120979-b876d301np6vmv1hlcu9kn1rvgg8097o.apps.googleusercontent.com" />
<link rel="apple-touch-icon-precomposed" href="https://www.windguru.net/img/apple-touch-icon-precomposed.png" />
<link rel="icon" href="https://www.windguru.net/img/windguru-icon-196x196.png" />
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600&subset=latin,latin-ext" rel="stylesheet" type="text/css" />
<script async="" src="//www.google-analytics.com/analytics.js"></script><script src="https://www.gstatic.com/firebasejs/5.0.4/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/5.0.4/firebase-messaging.js"></script>
<script>
// Initialize Firebase
var config = {
apiKey: "AIzaSyDwc6isuJ-h__wL8NbBgRvIYuJ_IoG1ubM",
authDomain: "windguru-1091.firebaseapp.com",
databaseURL: "https://windguru-1091.firebaseio.com",
projectId: "windguru-1091",
storageBucket: "windguru-1091.appspot.com",
messagingSenderId: "902500120979"
};
firebase.initializeApp(config);
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-885239-4', 'auto');
ga('set', 'anonymizeIp', true);
ga(function(tracker) {
window['WGGA_cid'] = tracker.get('clientId');
window['WGGA_tid'] = tracker.get('trackingId');
});
//ga('send', 'pageview');
</script>
<script type="text/javascript">
var WgLang = {"legend":{"SMER":"Wind direction","TMP":"Temperature","WINDSPD":"Wind speed","MWINDSPD":"Modif. wind","APCP":"Rain (mm\/3h)","TCDC":"Cloud cover (%)","HTSGW":"Wave","WAVESMER":"Wave direction","RATING":"Windguru rating","PERPW":"Wave period (s)","APCP1":"Rain (mm\/1h)","GUST":"Wind gusts","SLP":"<span class=\"helpinfhpa\">*Pressure (hPa)<\/span>","RH":"Humidity (%)","FLHGT":"<span class=\"helpinffl\">*0\u00b0 isotherm (m)<\/span>","CDC":"Cloud cover (%)<br\/>high \/ mid \/ low","TMPE":"<span class=\"helpinftmp\">*Temperature <\/span>","WCHILL":"Wind chill","APCPs":"<span class=\"helpinfsnow\">*Precip. (mm\/3h)<\/span>","APCP1s":"<span class=\"helpinfsnow\">*Precip. (mm\/1h)<\/span>","WVHGT":"Wind wave","WVPER":"Wind wave per.(s)","WVDIR":"Wind wave dir.","SWELL1":"Swell","SWPER1":"Swell period (s)","SWDIR1":"Swell direction","SWELL2":"2.Swell","SWPER2":"2.Swell period (s)","SWDIR2":"2.Swell dir.","DIRPW":"Wave direction","WAVEDIR":"Wave direction"},"tooltip":{"TMPE":"Temperature at 2 meters above surface adjusted to real altitude of the spot. More info in Help\/FAQ section.","SLP":"Sea level pressure in hPa, values above 1000 hPa are printed <b>as x-1000<\/b>","FLHGT":"Freezing level height in meters","sst":"Sea surface temperature based on satellite data. Valid for oceans and large lakes, more info in help\/FAQ","APCP1s":"Precipitation in milimeters. Bold blue numbers indicate snowfall.","APCPs":"Precipitation in milimeters. Bold blue numbers indicate snowfall."},"dir":["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"],"weekday":["Su","Mo","Tu","We","Th","Fr","Sa"],"txt":{"archive":"Archive","tides":"Tides","detail":"Detail \/ Map","link":"Link","timezone":"Timezone","help":"Help","options":"Options","choose_m":"Choose wind modification","loading":"Loading forecast...","delayed":"12 hours delayed forecast. Latest WRF forecasts are only available to Windguru PRO subscribers. <a href='help_index.php?sec=pro'>Click for more info.<\/a>","delayed_short":"12 hours delayed forecast. Latest WRF forecasts are only available to Windguru PRO subscribers.","custom_onlypro":"This forecast is only available to Windguru PRO subscribers","lastupdated":"Last updated","nextexpected":"Next update expected","timeleft":"Time left"},"tab":{"forecast":"Forecast","graph":"<img src=\"\/images\/gricon.png\" width=\"15\" height=\"10\"\/>","2d":"2D","2d_t":"Temperature (0 ... 5000 m)","2d_w":"Wind (0 ... 5000 m)","2d_t_l":"Temperature (alt ... +2000 m)","2d_w_l":"Wind (alt ... +2000 m)","map":"Map","webcams":"Webcams","reports":"Wind reports","accommodation":"Accommodation","schools":"Schools\/Rentals","shops":"Shops","other":"Other...","directory":"Links","fcst_graph":"<img src=\"\/img\/gricon.png\"\/>","more":"<span class=\"butt-txt\">More<\/span>","statistic":"Statistics","archive":"Archive","alert":"Add alert","share_widget":"Add to your website"},"units":{"kmh":"km\/h","mph":"mph","ms":"m\/s","msd":"m\/s","knots":"knots","bft":"Bft","c":"°C","f":"°F","m":"m","ft":"ft"},"maps":{"windspd":"Wind","t2m":"Temperature","press":"Pressure","tcdc_apcp3":"Rain \/ clouds","tcdc_apcp1":"Rain \/ clouds"},"mapsi":{"windspd":"wind","t2m":"temperature","press":"pressure","tcdc_apcp3":"precipitation","tcdc_apcp1":"precipitation"},"gmap":{"link_f":"Forecast","link_a":"Archive","link_d":"Detail","link_add":"Add to favourites","link_s":"Select"},"spotmenu":{"sel_zeme":"SELECT COUNTRY","sel_spot":"SELECT SPOT","num_spot":"spots","num_reg":"regions","num_zeme":"countries","sel_all":"ALL","qs_hint":"Type spot name (min. 3 characters)"},"langdir":{"dir":"int"}};
</script>
<script type="text/javascript" src="https://beta.windguru.net/js/pak/bs.min.000024.js?WGNOEXP"></script>
<script type="text/javascript" src="https://beta.windguru.net/js/pak/wg.min.000112.js?WGNOEXP"></script>
<script type="text/javascript" src="https://beta.windguru.net/js/min/WG.Ads.min.000013.js?WGNOEXP"></script>
<link rel="stylesheet" href="https://beta.windguru.net/css/min/index.min.000048.css?WGNOEXP" type="text/css" />
<script type="text/javascript">
WG.cdn = 'https://www.windguru.net';
WG.forecast_api = 'https://www.windguru.net/int/iapi.php';
WG.consent_new = 1;
WG.user = new WG.User();
WG.camblacklist = [1427387412]
WG._user_properties = {"id_user":0,"email":null,"username":"","wj":"knots","tj":"c","waj":"m","odh":3,"doh":22,"wrap":40,"fhours":240,"limit1":10.63,"limit2":15.57,"limit3":19.41,"tlimit":10,"vt":"forecast","directory":0,"wrapnew":null,"cellsize":null,"default_set":0,"default_id_spot":53,"consent_timestamp":0,"allow_personal_ads":false,"pro":false,"news_id":18,"news_pulse":1};
WG.ads.on = true;
WG.ads.ajax = true;
</script>
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script src="https://www.windguru.net/js/src/mapbox-gl.js"></script>
<script src="https://www.windguru.net//js/src/leaflet-mapbox-gl.js"></script>
<link rel="stylesheet" href="https://www.windguru.net/css/src/mapbox-gl.css" />
<script type="text/javascript">
if(navigator.serviceWorker) {
navigator.serviceWorker.register('/sw.php').catch(function(err) {
console.error('Unable to register service worker.', err);
});
}
</script>
<script type="text/javascript" src="https://beta.windguru.net/js/min/main.min.000070.js?WGNOEXP"></script>
<script>
$(function(){
if(WG.isRunningiOSStandalone()) {
WG.gae('standalone','ios');
}
if(WG.isRunningAndroidStandalone()) {
WG.gae('standalone','android');
}
});
</script>
<link rel="preload" href="https://adservice.google.co.in/adsid/integrator.js?domain=www.windguru.cz" as="script" /><script type="text/javascript" src="https://adservice.google.co.in/adsid/integrator.js?domain=www.windguru.cz"></script><link rel="preload" href="https://adservice.google.com/adsid/integrator.js?domain=www.windguru.cz" as="script" /><script type="text/javascript" src="https://adservice.google.com/adsid/integrator.js?domain=www.windguru.cz"></script><style>#-webkit-keyframes jBox-animation-zoomOutOpen-open {0% {-webkit-transform:scale(1.1);}100% {-webkit-transform:scale(1);}}.jBox-animation-zoomOutOpen-open {-webkit-animation-duration: 180ms;-webkit-animation-name: jBox-animation-zoomOutOpen-open;}#-webkit-keyframes jBox-animation-zoomOutClose-close {0% {-webkit-transform:scale(1);}100% {-webkit-transform:scale(1.1);}}.jBox-animation-zoomOutClose-close {-webkit-animation-duration: 180ms;-webkit-animation-name: jBox-animation-zoomOutClose-close;}</style><style>#-webkit-keyframes jBox-animation-zoomOutOpen-open {0% {-webkit-transform:scale(1.1);}100% {-webkit-transform:scale(1);}}.jBox-animation-zoomOutOpen-open {-webkit-animation-duration: 180ms;-webkit-animation-name: jBox-animation-zoomOutOpen-open;}#-webkit-keyframes jBox-animation-zoomOutClose-close {0% {-webkit-transform:scale(1);}100% {-webkit-transform:scale(1.1);}}.jBox-animation-zoomOutClose-close {-webkit-animation-duration: 180ms;-webkit-animation-name: jBox-animation-zoomOutClose-close;}</style></head>
<body id="body" class="with-nested-nicescroll content-bottom-menu pc">
<div class="nsr" style=""><div class="nsrr"></div></div>
<header id="header"> <!-- Horní lišta s logen a vetou -->
<nav id="nav-windguru"><!-- Navigacní lišta s levým a pravým menu -->
<a id="menu-button" class="main-mini-menu-icon collapsed"><svg xmlns="http://www.w3.org/2000/svg" class="icon light"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_menu"/></svg> </a>
<a id="menu-button-news" class="menu-news main-mini-menu-icon on pulse" style="" href="javascript:void(0)"><svg xmlns="http://www.w3.org/2000/svg" class="icon light"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_new"/></svg></a>
<div id="div_search_top"><!-- Autocomplete-->
<div class="logoleft"></div>
<div class="search_placeholder"> search spots...</div>
<input class="wg-guide" data-guide-priority="1" data-guide-src="qsearch.php" type="search" tabindex="-1" placeholder="" name="searchspot" id="searchspot" />
</div>
<style>
#sets-menu {
min-width: 280px !important;
}
</style>
<ul id="wg-main-menu" class="wg-main-menu sm sm-simple sm-simple-collapsible collapsed" data-smartmenus-id="1540549926798273">
<li class="wg-guide wg-guide-global hide_touch_bm_mobile" data-guide-priority="20" data-guide-src="maps-menu.php"><svg xmlns="http://www.w3.org/2000/svg" class="icon light"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_map"/></svg><span class="small-tablet-hide collapsed-show"> Maps</span>
<ul id="sm-1540549926798273-1" role="group" aria-hidden="true" aria-labelledby="showmap" aria-expanded="false">
<li><a data-navig="showMapFcst"><svg xmlns="http://www.w3.org/2000/svg" class="icon"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_forecast_map"/></svg><span class=""> Forecasts</span></a>
</li>
<li><a data-navig="showMapSpots"><svg xmlns="http://www.w3.org/2000/svg" class="icon"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_spot_map"/></svg><span class=""> Spots</span></a>
</li>
<li><a data-navig="showMapStations"><svg xmlns="http://www.w3.org/2000/svg" class="icon"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_station_map"/></svg><span class=""> Stations</span></a>
</li>
</ul>
</li>
<li><svg xmlns="http://www.w3.org/2000/svg" class="icon light"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_menu"/></svg><span class="tablet-hide collapsed-show"> More...</span>
<ul id="sm-1540549926798273-3" role="group" aria-hidden="true" aria-labelledby="sm-1540549926798273-2" aria-expanded="false">
<li><svg xmlns="http://www.w3.org/2000/svg" class="icon"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_top_forecast"/></svg> Top forecasts</li>
<li><svg xmlns="http://www.w3.org/2000/svg" class="icon"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_archive"/></svg> Archive</li>
<li><svg xmlns="http://www.w3.org/2000/svg" class="icon"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_statistic"/></svg> Statistics</li>
<li><svg xmlns="http://www.w3.org/2000/svg" class="icon"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_top_forecast"/></svg> Top spots</li>
<li><svg xmlns="http://www.w3.org/2000/svg" class="icon"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_tide"/></svg> Tides</li>
<li><svg xmlns="http://www.w3.org/2000/svg" class="icon"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_left"/></svg> Old Windguru</li>
<li class="min-small-tablet-hide collapsed-hide"><svg xmlns="http://www.w3.org/2000/svg" class="icon"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_wg"/></svg><span class=""> Windguru PRO</span>
</li>
<li class="min-small-tablet-hide collapsed-hide"><svg xmlns="http://www.w3.org/2000/svg" class="icon"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_phone"/></svg><span class=""> Mobile Apps</span>
</li>
<li class="min-small-tablet-hide collapsed-hide"><svg xmlns="http://www.w3.org/2000/svg" class="icon"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_center"/></svg><span class=""> Windguru Directory</span>
</li>
<li class="min-small-tablet-hide collapsed-hide"><a onclick="WG.forecastWidget();"><svg xmlns="http://www.w3.org/2000/svg" class="icon"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_share"/></svg><span class=""> Forecast widgets</span></a>
</li>
<li class="min-small-tablet-hide collapsed-hide"><svg xmlns="http://www.w3.org/2000/svg" class="icon"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_station_map"/></svg><span class=""> Windguru Station</span>
</li>
</ul>
</li>
<li class="small-tablet-hide collapsed-show"><svg xmlns="http://www.w3.org/2000/svg" class="icon light"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_wg"/></svg><span class="tablet-hide collapsed-show"> PROducts</span>
<ul id="sm-1540549926798273-5" role="group" aria-hidden="true" aria-labelledby="sm-1540549926798273-4" aria-expanded="false">
<li><svg xmlns="http://www.w3.org/2000/svg" class="icon"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_wg"/></svg><span class=""> Windguru PRO</span>
</li>
<li><svg xmlns="http://www.w3.org/2000/svg" class="icon"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_phone"/></svg><span class=""> Mobile Apps</span>
</li>
<li><svg xmlns="http://www.w3.org/2000/svg" class="icon"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_center"/></svg><span class=""> Windguru Directory</span>
</li>
<li><a onclick="WG.forecastWidget();"><svg xmlns="http://www.w3.org/2000/svg" class="icon"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_share"/></svg><span class=""> Forecast widgets</span></a>
</li>
<li><svg xmlns="http://www.w3.org/2000/svg" class="icon"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_station_map"/></svg><span class=""> Windguru Station</span>
</li>
</ul>
</li>
<li class="collapsed-show"><a class="mainmenu has-submenu" id="sm-1540549926798273-6" aria-haspopup="true" aria-controls="sm-1540549926798273-7" aria-expanded="false"><svg xmlns="http://www.w3.org/2000/svg" class="icon light"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_help"/></svg><span class="small-screen-hide collapsed-show"> Help</span></a>
<ul id="sm-1540549926798273-7" role="group" aria-hidden="true" aria-labelledby="sm-1540549926798273-6" aria-expanded="false">
<li><svg xmlns="http://www.w3.org/2000/svg" class="icon"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_new"/></svg> News</li>
<li><a class="click-menu-hide" data-navig="showGuide"><svg xmlns="http://www.w3.org/2000/svg" class="icon"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_help"/></svg> Quick guide</a>
</li>
<li><svg xmlns="http://www.w3.org/2000/svg" class="icon"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_model_selection"/></svg><span class=""> Help section</span>
</li>
<li><a class="click-menu-hide" data-navig="keyboardShortcuts"><svg xmlns="http://www.w3.org/2000/svg" class="icon"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_more_02"/></svg><span class=""> Keyboard shortcuts</span></a>
</li>
<li><svg xmlns="http://www.w3.org/2000/svg" class="icon"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_info"/></svg><span class=""> New site intro</span>
</li>
</ul>
</li>
</ul>
<svg xmlns="http://www.w3.org/2000/svg" class="logoright" src=""/>
<ul id="wg-main-menu2" class="wg-main-menu sm sm-simple sm-simple-collapsible collapsed" style="float: right;" data-smartmenus-id="1540549926807642">
<li class="menu-news on pulse" id="menu-button-news2"><a class="mainmenu" href="javascript:void(0)"><svg xmlns="http://www.w3.org/2000/svg" class="icon light"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_new"/></svg><span class="small-screen-hide collapsed-show"> News</span></a></li>
<li><a class="mainmenu modal-form" id="wg-options" data-q="set_options" data-title="Options" href="/forms/options.php"><svg xmlns="http://www.w3.org/2000/svg" class="icon light"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_options"/></svg><span class="big-tablet-hide collapsed-show"> Options</span></a></li>
<li class="wg-guide wg-guide-global" data-guide-priority="2" data-guide-src="login.php">
<svg xmlns="http://www.w3.org/2000/svg" class="icon light"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_account"/></svg><span class="tablet-hide collapsed-show"> Login</span>
</li>
<li class="small-mobile-hide collapsed-show"><img class="langflag w480-hide collapsed-show" src="https://www.windguru.net/img/flags/en.png" /><span class="small-mobile-hide collapsed-show">en</span>
<ul id="sm-1540549926807642-2" role="group" aria-hidden="true" aria-labelledby="sm-1540549926807642-1" aria-expanded="false"><li><img class="langflag" src="https://www.windguru.net/img/flags/baq.png" alt="baq" />Basque</li>
<li><img class="langflag" src="https://www.windguru.net/img/flags/bg.png" alt="bg" />Bulgarian</li>
<li><img class="langflag" src="https://www.windguru.net/img/flags/cat.png" alt="cat" />Catalan</li>
<li><img class="langflag" src="https://www.windguru.net/img/flags/cz.png" alt="cz" />Czech</li>
<li><img class="langflag" src="https://www.windguru.net/img/flags/dk.png" alt="dk" />Danish</li>
<li><img class="langflag" src="https://www.windguru.net/img/flags/nl.png" alt="nl" />Dutch</li>
<li><img class="langflag" src="https://www.windguru.net/img/flags/en.png" alt="en" />English</li>
<li><img class="langflag" src="https://www.windguru.net/img/flags/ee.png" alt="ee" />Estonian</li>
<li><img class="langflag" src="https://www.windguru.net/img/flags/fi.png" alt="fi" />Finnish</li>
<li><img class="langflag" src="https://www.windguru.net/img/flags/fr.png" alt="fr" />French</li>
<li><img class="langflag" src="https://www.windguru.net/img/flags/gl.png" alt="gl" />Galician</li>
<li><img class="langflag" src="https://www.windguru.net/img/flags/de.png" alt="de" />German</li>
<li><img class="langflag" src="https://www.windguru.net/img/flags/hu.png" alt="hu" />Hungarian</li>
<li><img class="langflag" src="https://www.windguru.net/img/flags/it.png" alt="it" />Italian</li>
<li><img class="langflag" src="https://www.windguru.net/img/flags/lv.png" alt="lv" />Latvian</li>
<li><img class="langflag" src="https://www.windguru.net/img/flags/lt.png" alt="lt" />Lithuanian</li>
<li><img class="langflag" src="https://www.windguru.net/img/flags/pl.png" alt="pl" />Polish</li>
<li><img class="langflag" src="https://www.windguru.net/img/flags/pt.png" alt="pt" />Portuguese</li>
<li><img class="langflag" src="https://www.windguru.net/img/flags/ro.png" alt="ro" />Romanian</li>
<li><img class="langflag" src="https://www.windguru.net/img/flags/ru.png" alt="ru" />Russian</li>
<li><img class="langflag" src="https://www.windguru.net/img/flags/es.png" alt="es" />Spanish</li>
<li><img class="langflag" src="https://www.windguru.net/img/flags/se.png" alt="se" />Swedish</li>
<li><img class="langflag" src="https://www.windguru.net/img/flags/tr.png" alt="tr" />Turkish</li>
</ul>
</li>
</ul>
</nav>
</header>
<div id="minimap" class=""></div>
<div id="news-div" class=""></div>
<div id="forecasts-page" class="subsection content">
<div id="warning-content"></div>
<div id="forecasts-page-content"></div><div class="end"></div><div id="forecasts-page-fmenu"></div>
<div id="bottom-menu-forecasts" class="forecasts-page-include menu fixed bottom higher dark subsection hide">
<a class="menu-button" onclick="WGA.goSearch();"><svg xmlns="http://www.w3.org/2000/svg" class="icon light"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_search"/></svg><span class=""> Search</span></a>
<a class="menu-button showfavo"><svg xmlns="http://www.w3.org/2000/svg" class="icon light"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_favourite"/></svg><span class=""> Favourites</span></a>
<svg xmlns="http://www.w3.org/2000/svg" class="icon light"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_map"/></svg><span class="small-tablet-hide collapsed-show"> Maps</span>
<a class="menu-button" onclick="WGA.options();"><svg xmlns="http://www.w3.org/2000/svg" class="icon light"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_options"/></svg><span class="big-tablet-hide collapsed-show"> Options</span></a> </div>
</div>
<div id="main-page" class="subsection content hide">
<div id="main-page-content"></div>
<div id="bottom-menu-main" class="main-page-include menu fixed bottom higher dark subsection hide">
<a class="menu-button" onclick="WGA.showHome();"><svg xmlns="http://www.w3.org/2000/svg" class="icon light"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_accommodation"/></svg><span class=""> Home </span></a>
<svg xmlns="http://www.w3.org/2000/svg" class="icon light"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_map"/></svg><span class="small-tablet-hide collapsed-show"> Maps</span>
<a class="menu-button" onclick="WGA.options();"><svg xmlns="http://www.w3.org/2000/svg" class="icon light"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico_options"/></svg><span class="big-tablet-hide collapsed-show"> Options</span></a> </div>
</div>
I can read a specific web page in Python2 quite easily:
>>> import urllib
>>> urllib.urlopen("http://www.pluralsight.com/authors")
<addinfourl at 4566566312 whose fp = <socket._fileobject object at 0x10fd18a50>>
When I try to read the same URL using Python3, however, I get an exception:
>>> from urllib.request import urlopen
>>> urlopen("http://www.pluralsight.com/authors")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/urllib/request.py", line 153, in urlopen
return opener.open(url, data, timeout)
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/urllib/request.py", line 461, in open
response = meth(req, response)
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/urllib/request.py", line 571, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/urllib/request.py", line 499, in error
return self._call_chain(*args)
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/urllib/request.py", line 433, in _call_chain
result = func(*args)
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/urllib/request.py", line 579, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
>>>
In Python 3, urllib.request.urlopen is equivalent to Python2's urllib2.urlopen, and urllib.urlopen has been removed.
You can see the differences and why you're getting an error in Python 3 in this SO question. Basically, urllib2.urlopen (urllib.request.urlopen in Python 3) handles the error for you, raising an exception, while urllib.urlopen just gives you the error as plain HTML.
Hope it helps.
It seems like it wasn't working in Python2 either:
u = urllib.urlopen("http://www.pluralsight.com/authors")
u.read()
#'<html><body><h1>403 Forbidden</h1>\nRequest
#forbidden by administrative rules.\n</body></html>\n\n'
You need to add a user-agent:
import urllib
req = urllib.request.Request(
"http://www.pluralsight.com/authors",
headers={
'User-Agent': 'Mozilla/5.0'
}
)
print(urllib.request.urlopen(req).read())
b'<!DOCTYPE html>\r\n<!--[if IE 8]>\r\n <html class="no-js lt-ie9" lang="en" ng-app="pluralsightModule">\r\n<![endif]-->\r\n<!--[if gt IE 8]><!-->\r\n<html class="no-js" lang="en" ng-app="pluralsightModule" id="ng-app">\r\n<!--<![endif]-->\r\n<head>\r\n <meta charset="utf-8" http-equiv="Content-type" content="text/html;" /><script type="text/javascript">window.NREUM||(NREUM={});NREUM.info = {"beacon":"bam.nr-data.net","errorBeacon":"bam.nr-data.net","licenseKey":"2700af8a3c","applicationID":"3058581","transactionName":"Z1ZRN0EDCEMDABVYWl4cdwxHLANEIQwPRUdfX18GQU0nRRYLDkNGH3pdB1Ya","queueTime":0,"applicationTime":3,"ttGuid":"88B4BF5354B4582F","agent":"js-agent.newrelic.com/nr-593.min.js"}</script><script type="text/javascript">(window.NREUM||(NREUM={})).loader_config={xpid:"VwUGVl5VGwAAUVlXDwA="};window.NREUM||(NREUM={}),__nr_require=function(t,e,n){function r(n){if(!e[n]){var o=e[n]={exports:{}};t[n][0].call(o.exports,function(e){var o=t[n][1][e];return r(o?o:e)},o,o.exports)}return e[n].exports}if("function"==typeof __nr_require)return __nr_require;for(var o=0;o<n.length;o++)r(n[o]);return r}({QJf3ax:[function(t,e){function n(t){function e(e,n,a){t&&t(e,n,a),a||(a={});for(var c=s(e),f=c.length,u=i(a,o,r),d=0;f>d;d++)c[d].apply(u,n);return u}function a(t,e){f[t]=s(t).concat(e)}function s(t){return f[t]||[]}function c(){return n(e)}var f={};return{on:a,emit:e,create:c,listeners:s,_events:f}}function r(){return{}}var o="nr#context",i=t("gos");e.exports=n()},{gos:"7eSDFh"}],ee:[function(t,e){e.exports=t("QJf3ax")},{}],3:[function(t){function e(t){try{i.console&&console.log(t)}catch(e){}}var n,r=t("ee"),o=t(1),i={};try{n=localStorage.getItem("__nr_flags").split(","),console&&"function"==typeof console.log&&(i.console=!0,-1!==n.indexOf("dev")&&(i.dev=!0),-1!==n.indexOf("nr_dev")&&(i.nrDev=!0))}catch(a){}i.nrDev&&r.on("internal-error",function(t){e(t.stack)}),i.dev&&r.on("fn-err",function(t,n,r){e(r.stack)}),i.dev&&(e("NR AGENT IN DEVELOPMENT MODE"),e("flags: "+o(i,function(t){return t}).join(", ")))},{1:23,ee:"QJf3ax"}],4:[function(t){function e(t,e,n,i,s){try{c?c-=1:r("err",[s||new UncaughtException(t,e,n)])}catch(f){try{r("ierr",[f,(new Date).getTime(),!0])}catch(u){}}return"function"==typeof a?a.apply(this,o(arguments)):!1}function UncaughtException(t,e,n){this.message=t||"Uncaught error with no additional information",this.sourceURL=e,this.line=n}function n(t){r("err",[t,(new Date).getTime()])}var r=t("handle"),o=t(6),i=t("ee"),a=window.onerror,s=!1,c=0;t("loader").features.err=!0,t(4),window.onerror=e;try{throw new Error}catch(f){"stack"in f&&(t(1),t(5),"addEventListener"in window&&t(2),window.XMLHttpRequest&&XMLHttpRequest.prototype&&XMLHttpRequest.prototype.addEventListener&&t(3),s=!0)}i.on("fn-start",function(){s&&(c+=1)}),i.on("fn-err",function(t,e,r){s&&(this.thrown=!0,n(r))}),i.on("fn-end",function(){s&&!this.thrown&&c>0&&(c-=1)}),i.on("internal-error",function(t){r("ierr",[t,(new Date).getTime(),!0])})},{1:10,2:7,3:11,4:3,5:9,6:24,ee:"QJf3ax",handle:"D5DuLP",loader:"G9z0Bl"}],5:[function(t){t("loader").features.ins=!0},{loader:"G9z0Bl"}],6:[function(t){function e(){}if(window.performance&&window.performance.timing&&window.performance.getEntriesByType){var n=t("ee"),r=t("handle"),o=t(1);t("loader").features.stn=!0,t(2),n.on("fn-start",function(t){var e=t[0];e instanceof Event&&(this.bstStart=Date.now())}),n.on("fn-end",function(t,e){var n=t[0];n instanceof Event&&r("bst",[n,e,this.bstStart,Date.now()])}),o.on("fn-start",function(t,e,n){this.bstStart=Date.now(),this.bstType=n}),o.on("fn-end",function(t,e){r("bstTimer",[e,this.bstStart,Date.now(),this.bstType])}),n.on("pushState-start",function(){this.time=Date.now(),this.startPath=location.pathname+location.hash}),n.on("pushState-end",function(){r("bstHist",[location.pathname+location.hash,this.startPath,this.time])}),"addEventListener"in window.performance&&(window.performance.addEventListener("webkitresourcetimingbufferfull",function(){r("bstResource",[window.performance.getEntriesByType("resource")]),window.performance.webkitClearResourceTimings()},!1),window.performance.addEventListener("resourcetimingbufferfull",function(){r("bstResource",[window.performance.getEntriesByType("resource")]),window.performance.clearResourceTimings()},!1)),document.addEventListener("scroll",e,!1),document.addEventListener("keypress",e,!1),document.addEventListener("click",e,!1)}},{1:10,2:8,ee:"QJf3ax",handle:"D5DuLP",loader:"G9z0Bl"}],7:[function(t,e){function n(t){i.inPlace(t,["addEventListener","removeEventListener"],"-",r)}function r(t){return t[1]}var o=(t(1),t("ee").create()),i=t(2)(o),a=t("gos");if(e.exports=o,n(window),"getPrototypeOf"in Object){for(var s=document;s&&!s.hasOwnProperty("addEventListener");)s=Object.getPrototypeOf(s);s&&n(s);for(var c=XMLHttpRequest.prototype;c&&!c.hasOwnProperty("addEventListener");)c=Object.getPrototypeOf(c);c&&n(c)}else XMLHttpRequest.prototype.hasOwnProperty("addEventListener")&&n(XMLHttpRequest.prototype);o.on("addEventListener-start",function(t){if(t[1]){var e=t[1];"function"==typeof e?this.wrapped=t[1]=a(e,"nr#wrapped",function(){return i(e,"fn-",null,e.name||"anonymous")}):"function"==typeof e.handleEvent&&i.inPlace(e,["handleEvent"],"fn-")}}),o.on("removeEventListener-start",function(t){var e=this.wrapped;e&&(t[1]=e)})},{1:24,2:25,ee:"QJf3ax",gos:"7eSDFh"}],8:[function(t,e){var n=(t(2),t("ee").create()),r=t(1)(n);e.exports=n,r.inPlace(window.history,["pushState"],"-")},{1:25,2:24,ee:"QJf3ax"}],9:[function(t,e){var n=(t(2),t("ee").create()),r=t(1)(n);e.exports=n,r.inPlace(window,["requestAnimationFrame","mozRequestAnimationFrame","webkitRequestAnimationFrame","msRequestAnimationFrame"],"raf-"),n.on("raf-start",function(t){t[0]=r(t[0],"fn-")})},{1:25,2:24,ee:"QJf3ax"}],10:[function(t,e){function n(t,e,n){var r=t[0];"string"==typeof r&&(r=new Function(r)),t[0]=o(r,"fn-",null,n)}var r=(t(2),t("ee").create()),o=t(1)(r);e.exports=r,o.inPlace(window,["setTimeout","setInterval","setImmediate"],"setTimer-"),r.on("setTimer-start",n)},{1:25,2:24,ee:"QJf3ax"}],11:[function(t,e){function n(){f.inPlace(this,p,"fn-")}function r(t,e){f.inPlace(e,["onreadystatechange"],"fn-")}function o(t,e){return e}function i(t,e){for(var n in t)e[n]=t[n];return e}var a=t("ee").create(),s=t(1),c=t(2),f=c(a),u=c(s),d=window.XMLHttpRequest,p=["onload","onerror","onabort","onloadstart","onloadend","onprogress","ontimeout"];e.exports=a,window.XMLHttpRequest=function(t){var e=new d(t);try{a.emit("new-xhr",[],e),u.inPlace(e,["addEventListener","removeEventListener"],"-",function(t,e){return e}),e.addEventListener("readystatechange",n,!1)}catch(r){try{a.emit("internal-error",[r])}catch(o){}}return e},i(d,XMLHttpRequest),XMLHttpRequest.prototype=d.prototype,f.inPlace(XMLHttpRequest.prototype,["open","send"],"-xhr-",o),a.on("send-xhr-start",r),a.on("open-xhr-start",r)},{1:7,2:25,ee:"QJf3ax"}],12:[function(t){function e(t){if("string"==typeof t&&t.length)return t.length;if("object"!=typeof t)return void 0;if("undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer&&t.byteLength)return t.byteLength;if("undefined"!=typeof Blob&&t instanceof Blob&&t.size)return t.size;if("undefined"!=typeof FormData&&t instanceof FormData)return void 0;try{return JSON.stringify(t).length}catch(e){return void 0}}function n(t){var n=this.params,r=this.metrics;if(!this.ended){this.ended=!0;for(var i=0;c>i;i++)t.removeEventListener(s[i],this.listener,!1);if(!n.aborted){if(r.duration=(new Date).getTime()-this.startTime,4===t.readyState){n.status=t.status;var a=t.responseType,f="arraybuffer"===a||"blob"===a||"json"===a?t.response:t.responseText,u=e(f);if(u&&(r.rxSize=u),this.sameOrigin){var d=t.getResponseHeader("X-NewRelic-App-Data");d&&(n.cat=d.split(", ").pop())}}else n.status=0;r.cbTime=this.cbTime,o("xhr",[n,r,this.startTime])}}}function r(t,e){var n=i(e),r=t.params;r.host=n.hostname+":"+n.port,r.pathname=n.pathname,t.sameOrigin=n.sameOrigin}if(window.XMLHttpRequest&&XMLHttpRequest.prototype&&XMLHttpRequest.prototype.addEventListener&&!/CriOS/.test(navigator.userAgent)){t("loader").features.xhr=!0;var o=t("handle"),i=t(2),a=t("ee"),s=["load","error","abort","timeout"],c=s.length,f=t(1);t(4),t(3),a.on("new-xhr",function(){this.totalCbs=0,this.called=0,this.cbTime=0,this.end=n,this.ended=!1,this.xhrGuids={}}),a.on("open-xhr-start",function(t){this.params={method:t[0]},r(this,t[1]),this.metrics={}}),a.on("open-xhr-end",function(t,e){"loader_config"in NREUM&&"xpid"in NREUM.loader_config&&this.sameOrigin&&e.setRequestHeader("X-NewRelic-ID",NREUM.loader_config.xpid)}),a.on("send-xhr-start",function(t,n){var r=this.metrics,o=t[0],i=this;if(r&&o){var f=e(o);f&&(r.txSize=f)}this.startTime=(new Date).getTime(),this.listener=function(t){try{"abort"===t.type&&(i.params.aborted=!0),("load"!==t.type||i.called===i.totalCbs&&(i.onloadCalled||"function"!=typeof n.onload))&&i.end(n)}catch(e){try{a.emit("internal-error",[e])}catch(r){}}};for(var u=0;c>u;u++)n.addEventListener(s[u],this.listener,!1)}),a.on("xhr-cb-time",function(t,e,n){this.cbTime+=t,e?this.onloadCalled=!0:this.called+=1,this.called!==this.totalCbs||!this.onloadCalled&&"function"==typeof n.onload||this.end(n)}),a.on("xhr-load-added",function(t,e){var n=""+f(t)+!!e;this.xhrGuids&&!this.xhrGuids[n]&&(this.xhrGuids[n]=!0,this.totalCbs+=1)}),a.on("xhr-load-removed",function(t,e){var n=""+f(t)+!!e;this.xhrGuids&&this.xhrGuids[n]&&(delete this.xhrGuids[n],this.totalCbs-=1)}),a.on("addEventListener-end",function(t,e){e instanceof XMLHttpRequest&&"load"===t[0]&&a.emit("xhr-load-added",[t[1],t[2]],e)}),a.on("removeEventListener-end",function(t,e){e instanceof XMLHttpRequest&&"load"===t[0]&&a.emit("xhr-load-removed",[t[1],t[2]],e)}),a.on("fn-start",function(t,e,n){e instanceof XMLHttpRequest&&("onload"===n&&(this.onload=!0),("load"===(t[0]&&t[0].type)||this.onload)&&(this.xhrCbStart=(new Date).getTime()))}),a.on("fn-end",function(t,e){this.xhrCbStart&&a.emit("xhr-cb-time",[(new Date).getTime()-this.xhrCbStart,this.onload,e],e)})}},{1:"XL7HBI",2:13,3:11,4:7,ee:"QJf3ax",handle:"D5DuLP",loader:"G9z0Bl"}],13:[function(t,e){e.exports=function(t){var e=document.createElement("a"),n=window.location,r={};e.href=t,r.port=e.port;var o=e.href.split("://");return!r.port&&o[1]&&(r.port=o[1].split("/")[0].split("#").pop().split(":")[1]),r.port&&"0"!==r.port||(r.port="https"===o[0]?"443":"80"),r.hostname=e.hostname||n.hostname,r.pathname=e.pathname,r.protocol=o[0],"/"!==r.pathname.charAt(0)&&(r.pathname="/"+r.pathname),r.sameOrigin=!e.hostname||e.hostname===document.domain&&e.port===n.port&&e.protocol===n.protocol,r}},{}],14:[function(t,e){function n(t){return function(){r(t,[(new Date).getTime()].concat(i(arguments)))}}var r=t("handle"),o=t(1),i=t(2);"undefined"==typeof window.newrelic&&(newrelic=window.NREUM);var a=["setPageViewName","addPageAction","setCustomAttribute","finished","addToTrace","inlineHit","noticeError"];o(a,function(t,e){window.NREUM[e]=n("api-"+e)}),e.exports=window.NREUM},{1:23,2:24,handle:"D5DuLP"}],gos:[function(t,e){e.exports=t("7eSDFh")},{}],"7eSDFh":[function(t,e){function n(t,e,n){if(r.call(t,e))return t[e];var o=n();if(Object.defineProperty&&Object.keys)try{return Object.defineProperty(t,e,{value:o,writable:!0,enumerable:!1}),o}catch(i){}return t[e]=o,o}var r=Object.prototype.hasOwnProperty;e.exports=n},{}],D5DuLP:[function(t,e){function n(t,e,n){return r.listeners(t).length?r.emit(t,e,n):(o[t]||(o[t]=[]),void o[t].push(e))}var r=t("ee").create(),o={};e.exports=n,n.ee=r,r.q=o},{ee:"QJf3ax"}],handle:[function(t,e){e.exports=t("D5DuLP")},{}],XL7HBI:[function(t,e){function n(t){var e=typeof t;return!t||"object"!==e&&"function"!==e?-1:t===window?0:i(t,o,function(){return r++})}var r=1,o="nr#id",i=t("gos");e.exports=n},{gos:"7eSDFh"}],id:[function(t,e){e.exports=t("XL7HBI")},{}],loader:[function(t,e){e.exports=t("G9z0Bl")},{}],G9z0Bl:[function(t,e){function n(){var t=l.info=NREUM.info;if(t&&t.licenseKey&&t.applicationID&&f&&f.body){s(h,function(e,n){e in t||(t[e]=n)}),l.proto="https"===p.split(":")[0]||t.sslForHttp?"https://":"http://",a("mark",["onload",i()]);var e=f.createElement("script");e.src=l.proto+t.agent,f.body.appendChild(e)}}function r(){"complete"===f.readyState&&o()}function o(){a("mark",["domContent",i()])}function i(){return(new Date).getTime()}var a=t("handle"),s=t(1),c=(t(2),window),f=c.document,u="addEventListener",d="attachEvent",p=(""+location).split("?")[0],h={beacon:"bam.nr-data.net",errorBeacon:"bam.nr-data.net",agent:"js-agent.newrelic.com/nr-593.min.js"},l=e.exports={offset:i(),origin:p,features:{}};f[u]?(f[u]("DOMContentLoaded",o,!1),c[u]("load",n,!1)):(f[d]("onreadystatechange",r),c[d]("onload",n)),a("mark",["firstbyte",i()])},{1:23,2:14,handle:"D5DuLP"}],23:[function(t,e){function n(t,e){var n=[],o="",i=0;for(o in t)r.call(t,o)&&(n[i]=e(o,t[o]),i+=1);return n}var r=Object.prototype.hasOwnProperty;e.exports=n},{}],24:[function(t,e){function n(t,e,n){e||(e=0),"undefined"==typeof n&&(n=t?t.length:0);for(var r=-1,o=n-e||0,i=Array(0>o?0:o);++r<o;)i[r]=t[e+r];return i}e.exports=n},{}],25:[function(t,e){function n(t){return!(t&&"function"==typeof t&&t.apply&&!t[i])}var r=t("ee"),o=t(1),i="nr#wrapper",a=Object.prototype.hasOwnProperty;e.exports=function(t){function e(t,e,r,a){function nrWrapper(){var n,i,s,f;try{i=this,n=o(arguments),s=r&&r(n,i)||{}}catch(d){u([d,"",[n,i,a],s])}c(e+"start",[n,i,a],s);try{return f=t.apply(i,n)}catch(p){throw c(e+"err",[n,i,p],s),p}finally{c(e+"end",[n,i,f],s)}}return n(t)?t:(e||(e=""),nrWrapper[i]=!0,f(t,nrWrapper),nrWrapper)}function s(t,r,o,i){o||(o="");var a,s,c,f="-"===o.charAt(0);for(c=0;c<r.length;c++)s=r[c],a=t[s],n(a)||(t[s]=e(a,f?s+o:o,i,s,t))}function c(e,n,r){try{t.emit(e,n,r)}catch(o){u([o,e,n,r])}}function f(t,e){if(Object.defineProperty&&Object.keys)try{var n=Object.keys(t);return n.forEach(function(n){Object.defineProperty(e,n,{get:function(){return t[n]},set:function(e){return t[n]=e,e}})}),e}catch(r){u([r])}for(var o in t)a.call(t,o)&&(e[o]=t[o]);return e}function u(e){try{t.emit("internal-error",e)}catch(n){}}return t||(t=r),e.inPlace=s,e.flag=i,e}},{1:24,ee:"QJf3ax"}]},{},["G9z0Bl",4,12,6,5]);</script>\r\n <meta name="viewport" content="width=device-width" />\r\n <meta name="fragment" content="!" />\r\n <title>Authors \xe2\x80\x93 Pluralsight Training</title>\r\n <link rel="stylesheet" href="//s.pluralsight.com/sc/css/app-a7dac6e6.css" />\r\n <link rel="stylesheet" href="//www.pluralsight.com/content/dist/css/fonts-a9675ca7.css" />\r\n <link href=\'//fonts.googleapis.com/css?family=Open+Sans:100,200,300,400,500,600,700,800,900\' rel=\'stylesheet\' type=\'text/css\'>\r\n <!--[if lte IE 9]>\r\n <link rel="stylesheet" href="//s.pluralsight.com/sc/css/ie-app-1bed8c68.css" />\r\n <![endif]-->\r\n <!--[if IE 8]>\r\n <link rel="stylesheet" href="//s.pluralsight.com/sc/css/ie8-62d3a852.css" />\r\n <![endif]-->\r\n <!--[if IE]>\r\n <link rel="stylesheet" href="//s.pluralsight.com/sc/css/ie-7dd5dc87.css" />\r\n <![endif]-->\r\n\r\n <script src="//s.pluralsight.com/sc/js/vendor/custom.modernizr-b4b7741a.js"></script>\r\n\r\n \r\n \r\n \r\n <script src="//cdn.optimizely.com/js/1252788015.js"></script>\r\n\r\n</head>\r\n<body>\r\n <!-- Google Tag Manager -->\r\n<noscript>\r\n <iframe src="//www.googletagmanager.com/ns.html?id=GTM-MNK9CB" height="0" width="0" style="display:none;visibility:hidden"></iframe>\r\n</noscript>\r\n<script>\r\n (function (w, d, s, l, i) {\r\n w[l] = w[l] || [];\r\n w[l].push({ \'gtm.start\': new Date().getTime(), event: \'gtm.js\' });\r\n var f = d.getElementsByTagName(s)[0],\r\n j = d.createElement(s),\r\n dl = l != \'dataLayer\' ? \'&l=\' + l : \'\';\r\n j.async = true;\r\n j.src = \'//www.googletagmanager.com/gtm.js?id=\' + i + dl;\r\n f.parentNode.insertBefore(j, f);\r\n })(window, document, \'script\', \'dataLayer\', \'GTM-MNK9CB\');\r\n</script>\r\n<!-- End Google Tag Manager -->\r\n\r\n <input type="hidden" id="pageObjectTag" value="AuthorsPage" />\r\n <div ng-controller="AuthenticationController">\r\n <div ng-include src="\'/header\'"></div>\r\n\r\n \r\n\r\n<!-- HERO UNIT -->\r\n<section class="teal-hex-bg hero">\r\n <div class="row">\r\n <div class="small-12 columns">\r\n <h1 class="medium">Our authors</h1>\r\n <h4 class="normal">Our original courses are authored by an elite group of tech and creative professionals, innovators and leaders. We take pride in only working with the best.</h4>\r\n <h5 class="authors-invite-to-teach"><strong>Want to join us?</strong></h5>\r\n <a class="teal button" href="/teach">Learn more</a>\r\n </div>\r\n </div>\r\n</section><!-- /HERO UNIT -->\r\n<!-- SECTION TITLE -->\r\n<section class="band" ng-controller="AuthorsController">\r\n\r\n <div class="row">\r\n <div class="small-12 columns">\r\n <div loading show="loading"></div>\r\n <div class="author-group" ng-cloak ng-repeat="(key, value) in authors">\r\n <p class="underline">{{key.toUpperCase()}}</p>\r\n <ul class="inline-list" >\r\n <li ng-repeat="author in value"><a class="panel" ng-href="/author/{{author.handle}}">{{author.fullName}}</a></li>\r\n </ul>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n</section>\r\n\r\n </div>\r\n <footer ng-controller="FooterController">\r\n <div class="row">\r\n <!-- MAIN FOOTER STUFF -->\r\n <div class="large-4 columns">\r\n <img src="//s.pluralsight.com/sc/img/layout/logo-grey-v3.png" class="secondary-logo" />\r\n <p>\r\n Our mission is to publish high quality online training courses for professional developers, IT admins and creative artists. Every day.\r\n </p>\r\n <!-- facebook -->\r\n <a class="facebook social button" href="http://www.facebook.com/pluralsight" target="_blank" rel="nofollow">\r\n <span class="icon">\r\n <i class="social fi-social-facebook"></i>\r\n </span>\r\n Facebook\r\n <span ng-class="{\'number\': social.likes != undefined}" ng-cloak>{{social.likes | number}}</span>\r\n </a>\r\n <!-- twitter -->\r\n <a class="twitter social button" href="http://twitter.com/pluralsight" target="_blank" rel="nofollow">\r\n <span class="icon">\r\n <i class="social fi-social-twitter"></i>\r\n </span>\r\n Twitter\r\n <span ng-class="{\'number\': social.followers != undefined}" ng-cloak>{{social.followers | number}}</span>\r\n </a>\r\n <!-- google+ -->\r\n <a class="google social button" href="http://plus.google.com/+pluralsight" target="_blank" rel="nofollow">\r\n <span class="icon">\r\n <i class="social fi-social-google-plus"></i>\r\n </span>\r\n Google+\r\n <span ng-class="{\'number\': social.plusOnes != undefined}" ng-cloak>{{social.plusOnes | number}}</span>\r\n </a>\r\n <!-- newsletter -->\r\n <p>Subscribe to our newsletter for weekly updates.</p>\r\n <div class="row collapse signup-form">\r\n <form action="https://go.pardot.com/l/36882/2014-08-27/yj3h" method="POST">\r\n <div class="small-8 columns">\r\n <input type="text" placeholder="Email" name="UserInfo.Email" ng-focus="newsletterEmailFocus()" />\r\n </div>\r\n <div class="small-4 columns">\r\n <input class="button postfix" type="submit" name="submit" value="Submit">\r\n </div>\r\n </form>\r\n\r\n </div>\r\n </div>\r\n <!-- SITE MAP -->\r\n <div class="large-7 large-offset-1 columns">\r\n <div class="row">\r\n <div class="large-4 columns">\r\n <h5>Learn</h5>\r\n <ul class="side-nav">\r\n <li>Browse Courses</li>\r\n <li>Learning Paths</li>\r\n </ul>\r\n <h5>Products</h5>\r\n <ul class="side-nav">\r\n <li>Individual Plans</li>\r\n <li>Business Plans</li>\r\n <li>Free Trial</li>\r\n <li>Academic</li>\r\n <li>Government</li>\r\n </ul>\r\n </div>\r\n <div class="large-4 columns">\r\n <h5>Community</h5>\r\n <ul class="side-nav">\r\n <li>Free Kids Courses</li>\r\n <li>Official Blog</li>\r\n <li>Study Groups</li>\r\n <li>UG & Event Sponsorships</li>\r\n </ul>\r\n <h5>Support</h5>\r\n <ul class="side-nav">\r\n <li>Ask Support a Question</li>\r\n <li>Suggest a Course</li>\r\n <li>Support & Feedback</li>\r\n <li>Knowledge Base / FAQ</li>\r\n <li>Terms of Use</li>\r\n </ul>\r\n </div>\r\n <div class="large-4 columns">\r\n <h5>Features</h5>\r\n <ul class="side-nav">\r\n <li>Mobile Apps</li>\r\n <li>Offline Viewing</li>\r\n </ul>\r\n <h5>About</h5>\r\n <ul class="side-nav">\r\n <li>Contact Us</li>\r\n <li>Press Center</li>\r\n <li>About Us</li>\r\n <li>Authors</li>\r\n <li>Teach</li>\r\n <li>Jobs at Pluralsight</li>\r\n </ul>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </footer>\r\n\r\n <script src="//s.pluralsight.com/sc/js/bundled/vendor-46f7b492.js"></script>\r\n <script src="//s.pluralsight.com/sc/js/bundled/app-d238c035.js"></script>\r\n\r\n\r\n <script type="text/javascript">\r\n pluralsightModule.factory(\'baseUrls\', function () {\r\n return {\r\n dataUrl: \'/data\',\r\n mvcUrl: \'//www.pluralsight.com/a\',\r\n mainWebUrl: \'//www.pluralsight.com/training\',\r\n staticCdnUrl: \'http://s.pluralsight.com\',\r\n staticUrl: \'//www.pluralsight.com\',\r\n contentUrl: \'//s.pluralsight.com/sc\'\r\n };\r\n })\r\n .factory(\'validationService\', function () {\r\n return {\r\n emailAddressPattern: \'/^[a-zA-Z0-9'._%+-]+#[a-zA-Z0-9-][a-zA-Z0-9.-]*\\.[a-zA-Z]{2,63}$/\'\r\n };\r\n })\r\n .factory(\'settingsProvider\', function ($resource) {\r\n return {\r\n featureToggleMarketoFormHandlers: String(false) == \'true\',\r\n featureToggleLinkedIn: String(false) == \'true\'\r\n };\r\n });\r\n \r\n\r\n </script>\r\n\r\n <script type="text/javascript">\r\n var hero = $(".hero") || $("header");\r\n hero.after(\'<div class="global-message-bar" ng-cloak ng-controller="MessageBarController" ng-show="hasMessage()"><div class="row"><div class="small-12 columns"><i class="fi-x"></i><span class="message-text">{{getMessage()}}</span></div></div></div>\');\r\n </script>\r\n\r\n \r\n</body>\r\n</html>\r\n'
Or use requests:
import requests
r = requests.get("http://www.pluralsight.com/authors")
print(r.content)