Skip to content

Instantly share code, notes, and snippets.

#! /usr/bin/python
# coding:utf-8
import urllib.request
import http.cookiejar
import re
class WebPage():
def __init__(self,url):
self.url = url
cj = http.cookiejar.CookieJar()
opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cj))
#! /usr/bin/python
# coding:utf-8
import urllib.request
import re
import http.cookiejar
url = 'http://www.lvye.org/user.php'
user_url = 'http://www.lvye.org/modules/news/article.php?storyid=20'
user_agent = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36'
referer = 'http://www.lvye.org/'
value = {
#! /usr/bin/python
# -*- coding:utf-8 -*-
#代码有一些问题,不能输入中文,这个初期版,以后再修改
import urllib.request
import re
def get_page():
city = input('请输入你所在的城市:')
url = 'http://php.weather.sina.com.cn/search.php?f=1&c=1&city=' + city + '&dpc=1'
user_agent = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36'
#! /usr/bin/python
# -*- coding:utf-8 -*-
import requests
from bs4 import BeautifulSoup
import re
from urllib.request import HTTPError
import time
import os
from _ast import Num
class Mymm():
@wangx2
wangx2 / 代码还需要完善。
Created May 26, 2016 13:44
python爬虫抓取美女图片
#! /usr/bin/python3
# -*- coding:utf-8 -*-
import requests
import re
from bs4 import BeautifulSoup
import time
class Mymm():
def __init__(self, url):
self.url = url