The descusr web application development framework, a drequests project
Project description
drequests
=======
Before install drequests,make sure had installed pydomain("sudo pip install pydomain")
drequests is an Apache2 Licensed HTTP library, written in Python, for human beings.
Python’s standard pycurl2 module provides most of the HTTP capabilities you need, but the API is thoroughly broken. It was built for a different time — and a different web. It requires an enormous amount of work (even method overrides) to perform the simplest of tasks..
Things shouldn’t be this way. Not in Python.
>>>from drequests import DRequests
>>>resp = DRequests(url = 'http://www.piadu.com')
>>>resp.status_code
200
>>>resp.text
<html ....
1.3
e.g.
from drequests import DRequests
url = 'http://www.piadu.com'
resp = DRequests(url = url,referer = url,useragent = "Mozilla/5.0 (X11; Linux x86_64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1",followlocation = 1)
#取响应码
code = resp.status_code
#取响应头
header = resp.headers
#取页面内容
html = resp.text
#修改获取IP方式,以前使用socket获取,现在改为使用pycurl2直接获取。
=======
Before install drequests,make sure had installed pydomain("sudo pip install pydomain")
drequests is an Apache2 Licensed HTTP library, written in Python, for human beings.
Python’s standard pycurl2 module provides most of the HTTP capabilities you need, but the API is thoroughly broken. It was built for a different time — and a different web. It requires an enormous amount of work (even method overrides) to perform the simplest of tasks..
Things shouldn’t be this way. Not in Python.
>>>from drequests import DRequests
>>>resp = DRequests(url = 'http://www.piadu.com')
>>>resp.status_code
200
>>>resp.text
<html ....
1.3
e.g.
from drequests import DRequests
url = 'http://www.piadu.com'
resp = DRequests(url = url,referer = url,useragent = "Mozilla/5.0 (X11; Linux x86_64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1",followlocation = 1)
#取响应码
code = resp.status_code
#取响应头
header = resp.headers
#取页面内容
html = resp.text
#修改获取IP方式,以前使用socket获取,现在改为使用pycurl2直接获取。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
drequests-1.3.tar.gz
(4.9 kB
view details)
File details
Details for the file drequests-1.3.tar.gz
.
File metadata
- Download URL: drequests-1.3.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 772db3142237e2cbf56dfab4ce62c2dd65a3d6b11df0ec2f3381df69d32ea784 |
|
MD5 | 6c35b771943c5b0b787f8d0fa9d5b28b |
|
BLAKE2b-256 | 7b9a6c979bffb25d369404bce55cfbe1c5e325b139cc8ad62f714b215e16a668 |