Skip to content

Instantly share code, notes, and snippets.

View lolosssss's full-sized avatar
😛
Nothing to do

Evan lolosssss

😛
Nothing to do
View GitHub Profile
@lolosssss
lolosssss / downloading_a_web_page.py
Created September 30, 2018 07:57
Downloading a web page with 5XX retry
import urllib.request
from urllib.error import URLError, HTTPError, ContentTooShortError
def download(url, num_retries=2):
print('Downloading:', url)
try:
html = urllib.request.urlopen(url).read()
except (URLError, HTTPError, ContentTooShortError) as e:
print('Download error:', e.reason)
html = None
@lolosssss
lolosssss / index.html
Created September 3, 2014 11:41
Bread and Knife[my testing website]// source http://jsbin.com/mohiz/14
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[add your bin description]" />
<meta charset="utf-8">
<title>Bread and Knife</title>
<style>
body{
background:url("http://image.tianjimedia.com/uploadImages/2014/107/54/TO5360RI1R33_1000x500.jpg");
background-size:cover;