jknupp

Joined 17 years ago

Karma
1,116
Submissions
187
Member since
Jul 17
email: <my-user-name>@gmail.com

[ my public key: https://keybase.io/jeffknupp; my proof: https://keybase.io/jeffknupp/sigs/7Io3CXiZL-UByymj5V_cg4qQ1ZE5OalCTIpHKIhf1oU ]

View on Hacker News

Recent submissions

Comment · 12 years ago
A shorter, more comprehensible version:

import requests

from bs4 import BeautifulSoup

from urlparse import urljoin

URL = 'http://philadelphia.craigslist.org/search/sss?sort=date&quer...

BASE = 'http://philadelphia.craigslist.org/cpg/'

response = requests.get(URL)

soup = BeautifulSoup(response.content)

for listing in soup.find_all('p',{'class':'row'}):

    if listing.find('span',{'class':'price'}):

        price = int(listing.text[2:6])

        if 100 < price <=250:

            print listing.text

            print urljoin(BASE, listing.a['href']) + '\n'
Comment · 12 years ago
I never accused him of being a homophobe, I simply stated all that I can glean from the facts: he doesn't believe homosexuals should be allowed to marry.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton