博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
126邮箱自动登录程序
阅读量:4149 次
发布时间:2019-05-25

本文共 976 字,大约阅读时间需要 3 分钟。

PythonCode:
#python 小桂制作 2008- 8 -4 import sys, urllib2, urllib,cookielib import re cookie = cookielib.LWPCookieJar() opener=urllib2.build_opener(urllib2.HTTPCookieProcessor(cookie)) urllib2.install_opener(opener) url='http://entry.mail.126.com/cgi/login?hid=10010102&lightweight=1&language=0&style=11' user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' headers = { 'User-Agent' : user_agent } values = {
'bCookie' : '', 'domain' : '126.com', 'enter.x' : '登 录', 'language':'0', 'pass':'#####', 'style':'11', 'user':'guijia8427'} data = urllib.urlencode(values) req = urllib2.Request(url, data ,headers) response = urllib2.urlopen(req) the_page = response.read() sor= re.compile(r'sid=(.+)&funcid') s=sor.findall(the_page) url2='http://tg1a3.mail.126.com/coremail/fcg/ldapapp?funcid=mails&sid='+s[0]+'&fid=1' g=opener.open(url2) data2=g.read() file=open('126.html','w') file.write(data2) file.close()

转载地址:http://qesti.baihongyu.com/

你可能感兴趣的文章
[LeetCode]Unique Paths
查看>>
[LeetCode]Unique Paths II
查看>>
[LeetCode]Valid Number
查看>>
[LeetCode]Valid Palindrome
查看>>
[LeetCode]Valid Parentheses
查看>>
[LeetCode]Valid Sudoku
查看>>
[LeetCode]Validate Binary Search Tree
查看>>
[LeetCode]Wildcard Matching
查看>>
[LeetCode]Word Ladder
查看>>
[LeetCode]Word Ladder II
查看>>
[LeetCode]Word Search
查看>>
[LeetCode]ZigZag Conversion
查看>>
Divide and Conquer
查看>>
Greedy
查看>>
Dynamic Programming
查看>>
Sorting
查看>>
Bit manipulation
查看>>
Swap all odd and even bits
查看>>
Binary representation of a given number
查看>>
Position of rightmost set bit
查看>>