python模擬登入網易郵箱
python模擬登入網易郵箱
#coding:utf-8
import urllib2,urllib
import cookielib
from bs4 import BeautifulSoup
#設定代理IP
proxy_support = urllib2.ProxyHandler({'http':'120.197.234.164:80'})
#設定cookie
cookie_support = urllib2.HTTPCookieProcessor(cookielib.LWPCookieJar())
opener = urllib2.build_opener(proxy_support,cookie_support,urllib2.HTTPHandler)
urllib2.install_opener(opener)
#開始的URL
#hosturl = "http://www.renren.com"
hosturl = "http://mail.163.com/"
#接受表單資料的URL
#posturl = "http://www.renren.com/ajaxLogin/login"
posturl = "https://mail.163.com/entry/cgi/ntesdoor?df=mail163_letter&from=web&funcid=loginone&iframe=1&language=-1&passtype=1&product=mail163&net=e&style=-1&race=118_35_39_bj&uid=Thinkgamer@163.com"
#傳送表單資料
postdata = urllib.urlencode(
{
"username":"xxxxxxxxxxx",
"password":"xxxxxxxxxxxxxxx"
}
)
#設定表頭
headers = {
#'User-Agent':'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0/',
#'Referer':'http://www.renren.com/'
'User-Agent':"Mozilla/5.0 (Windows NT 6.3; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0",
'Referer':'http://mail.163.com/'
}
#生成HTTP請求
req =urllib2.Request(
url = posturl,
data = postdata,
headers = headers
)
print req
page = urllib2.urlopen(req).read()
print page
listvalue = page.split(";")
url = listvalue[0].split("op.location.href = ")[1]
href = url[1:-1]
print href
soup = BeautifulSoup(urllib2.urlopen(href))
print soup.title
相關文章
- Python-模擬登入Python
- Python系列模擬登入之網易雲個人歌單下載器Python
- 利用Python模擬GitHub登入PythonGithub
- python使用Cookie模擬登入PythonCookie
- Python+django實現郵箱驗證登入PythonDjango
- win10自帶郵箱無法登入QQ郵箱Win10
- Python爬蟲之模擬知乎登入Python爬蟲
- Python 爬蟲(七)-- Scrapy 模擬登入Python爬蟲
- Python 爬蟲模擬登入方法彙總Python爬蟲
- 用python實現模擬登入人人網Python
- python模擬使用者登入某某網Python
- 關於QQ郵箱登入提示一鍵登入解決方案
- 網易郵箱的CSS開發(一)CSS
- 【Java】——模擬登入實現Java
- 網易郵箱昨晚無法登陸 回應:因系統升級所致
- 如何把 Laravel 預設郵箱登入改成使用者名稱登入Laravel
- Python爬蟲實戰之(五)| 模擬登入wechatPython爬蟲
- 網易郵箱回應大量賬號被叫賣:僅涉及郵箱地址 已報案
- C#模擬登入總結C#
- python清空郵箱Python
- QQ模擬登入實現後篇
- 使用 mock 模擬登入介面資料Mock
- golang 模擬瀏覽器登入操作Golang瀏覽器
- 實戰模擬│JWT 登入認證JWT
- Java實現網易企業163郵箱傳送郵件Java
- Python爬蟲實戰之(四)| 模擬登入京東商城Python爬蟲
- Python模擬微博登陸,親測有效Python
- python模擬登陸知乎(最新版)Python
- 使用python模擬登陸百度Python
- 蘋果保護隱私出大招:虛擬郵箱幫使用者登入第三方蘋果
- Python培訓分享:python如何用cookie實現自動模擬登入?PythonCookie
- 爬蟲模擬登入—OAUTH的詳解爬蟲OAuth
- SQL Server模擬別的賬戶登入SQLServer
- win10自帶郵件怎麼新增qq郵箱_win10郵箱如何匯入qq郵箱Win10
- 怎麼登陸163郵箱?163的郵箱有哪些實用技巧?
- win10自帶的郵箱軟體無法同步網易163郵箱如何解決Win10
- icloud郵箱怎麼在win10上登陸_icloud郵箱如何在win10上登陸CloudWin10
- 雲開發CloudBase | 基本配置&使用者郵箱登入開發Cloud