Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

craigsgenerator-0.1.0.tar.gz (3.9 kB view details)

Uploaded Source

File details

Details for the file craigsgenerator-0.1.0.tar.gz.

File metadata

File hashes

Hashes for craigsgenerator-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ff21a145481e16f347fd628534492758e54446756bd2648eea48867d425dca21
MD5 7679fccfb58e973e2f6df523f0d5eb43
BLAKE2b-256 9b0e6cddc07836951459d663c291a94e571c18a06f0545f7f36236509e6bf3d1

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page