#!/usr/bin/python
#coding:UTF-8
importurllib,urllib2,cookielib,time,re,random
classLogin:
_loginurl=‘http://home.51cto.com/index.php?s=/Index/doLogin‘
_ua=‘*****‘#username
_ps=‘*****‘#password
_re=‘src="(.+?)"‘
_headers=[(‘User-agent‘,‘Mozilla/4.0(compati..
分类:
编程语言 时间:
2015-08-19 17:43:20
阅读次数:
178
一.htpp协议报文请求报文语法<method><request-URL><version>//version为http的版本号<headers>//http协议首部,有很多如Host,Connection//空白行必须的<entity-body>//报文的主体,get时没有主体部分响应报文语法<version><status>..
分类:
Web程序 时间:
2015-08-19 02:08:37
阅读次数:
443
在平时测试当中经常会遇到使用python脚本来模拟http请求的操作,在做一次接口【http请求,返回json】测试时,开发提供的http接口在请求时,会被filter拦截,验证请求者的session是否合法,由于我们是直接请求,没有附带任何的cookie与headers,那如何让我们合法的进行.....
分类:
编程语言 时间:
2015-08-17 11:50:49
阅读次数:
156
#-*-coding:utf-8-*-
__author__=‘magicpwn‘
importurllib2
importurllib
importCookie
#无参数时,一般访问用法及返回信息的获取
respon=urllib2.urlopen(‘http://www.baidu.com‘)
print‘code:‘,respon.getcode(),‘URL:‘,respon.geturl()
print‘==================Headers====..
分类:
编程语言 时间:
2015-08-17 07:40:28
阅读次数:
341
这节看一下字符串相关的: TString 数据结构如下所示,可以看到,TString 不单用于处理字符串,还可用于处理用户自定义数据。 /*
**?String?headers?for?string?table
*/
/*
**?most?`malloc‘?libraries...
分类:
其他好文 时间:
2015-08-15 18:40:30
阅读次数:
163
spring3.0mvc在从后台向前台返回时要转化成json串,但页面上报了Theresourceidentifiedbythisrequestisonlycapableofgeneratingresponseswithcharacteristicsnotacceptableaccordingtotherequest"accept"headers异常信息org.springframework.web.HttpMediaTypeNotAcceptableExc..
分类:
编程语言 时间:
2015-08-12 19:48:04
阅读次数:
134
MobileTokenCloudClient.java/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose To...
分类:
Web程序 时间:
2015-08-12 18:42:23
阅读次数:
206
最近需要模拟游戏登陆,蛋疼 1 #coding=utf-8 2 import os 3 import urllib 4 import urllib2 5 import re 6 import cookielib 7 import json 8 9 10 headers = {}11 headers....
分类:
编程语言 时间:
2015-08-11 14:01:39
阅读次数:
225
#coding:utf-8importtimeimportrandomimporturllib2frombs4importBeautifulSoup#引入beautifulsoup模块#p=1#定义页url=‘http://www.qiushibaike.com/text/page/‘#定义headermy_headers=[‘Mozilla/5.0(WindowsNT6.1;WOW64;rv:39.0)Gecko/20100101Firefox/39.0‘,‘Mozilla/4.0(com..
分类:
编程语言 时间:
2015-08-06 18:35:20
阅读次数:
281
UserPortalStatisticExportService.java/* * To change this license header, choose License Headers in Project Properties. * To change this template file,...
分类:
编程语言 时间:
2015-08-05 14:35:51
阅读次数:
807