Iterate through Craig's list
Project description
Read listings Pythonically.
Examples
Generate listings.
from craigsgenerator import Section
for listing in Section('austin','sub'):
print(listing)
Additional arguments get passed to requests.get
.
from craigsgenerator import Section
proxies = {'https':'example.com'}
for listing in Section('austin','sub', proxies = proxies):
print(listing)
Downloaded files are cached by default and refreshed
if they’re older than a day. Change the directory by
specifying the cachedir
.
from craigsgenerator import Section
for listing in Section('austin','sub', cachedir = 'downloads'):
print(listing)
Disable caching by setting the cachedir
to None
.
from craigsgenerator import Section, fulltext
for listing in Section('austin','sub', cachedir = None):
print(listing)
Get the full text of the listing with the fulltext
function.
from craigsgenerator import Section
for listing in Section('austin','sub'):
print(listing)
print(fulltext(listing))
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
File details
Details for the file craigsgenerator-0.0.13.tar.gz
.
File metadata
- Download URL: craigsgenerator-0.0.13.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7bd6b2d754f3acb9582ab777fe40c083409c71c3fb6d61d4dca93e3a047d0b19 |
|
MD5 | 69970bdfdcce8983c9d60c3669f24145 |
|
BLAKE2b-256 | c33f4398a9eca1d6b12a42f6bb97004481473a835dc317d4d003b8780212d0b4 |