This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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 = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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)) |