Traceback (most recent call last):
File "./tickets.py", line 20, in
for listing in soup.findall('p', {'class': 'row'}):
TypeError: 'NoneType' object is not callableFinding the best ticket price – Simple web scraping with Python
11–20 of 36 posts
Re: Finding the best ticket price – Simple web scraping with Python
#12Doesn't work for me. Which Python version is required? Traceback (most recent call last): File "./tickets.py", line 20, in for listing in soup.findall('p', {'class': 'row'}): TypeError: 'NoneType' object is not callable
Re: Finding the best ticket price – Simple web scraping with Python
#13You should integrate this in weboob [0] [0] http://weboob.org/
Re: Finding the best ticket price – Simple web scraping with Python
#14Re: Finding the best ticket price – Simple web scraping with Python
#15Doesn't work for me. Which Python version is required? Traceback (most recent call last): File "./tickets.py", line 20, in for listing in soup.findall('p', {'class': 'row'}): TypeError: 'NoneType' object is not callable
I am using 2.7.6
$ sudo pip install BeautifulSoup
Downloading/unpacking BeautifulSoup
Downloading BeautifulSoup-3.2.1.tar.gz
Running setup.py (path:/tmp/pip_build_root/BeautifulSoup/setup.py) egg_info for package BeautifulSoup
Installing collected packages: BeautifulSoup
Running setup.py install for BeautifulSoup
Successfully installed BeautifulSoup
Cleaning up...Re: Finding the best ticket price – Simple web scraping with Python
#16Earlier quoted context omitted.
That really isn't a good name.
Seems to be their thing QHandJoob QFlatBoob
"QHaveDate is a graphical application able to interact with dating websites, and help you manage your numerous conquests."
I, uh, don't really know where to start with that.
Re: Finding the best ticket price – Simple web scraping with Python
#17Earlier quoted context omitted.
I am using 2.7.6
Maybe wrong BS version? $ sudo pip install BeautifulSoup Downloading/unpacking BeautifulSoup Downloading BeautifulSoup-3.2.1.tar.gz Running setup.py (path:/tmp/pip_build_root/BeautifulSoup/setup.py) egg_info for package BeautifulSoup Installing collected packages: BeautifulSoup Running setup.py install for BeautifulSoup Successfully installed BeautifulSoup Cleaning up...
Try pip install beautifulsoup4
Re: Finding the best ticket price – Simple web scraping with Python
#18Earlier quoted context omitted.
Maybe wrong BS version? $ sudo pip install BeautifulSoup Downloading/unpacking BeautifulSoup Downloading BeautifulSoup-3.2.1.tar.gz Running setup.py (path:/tmp/pip_build_root/BeautifulSoup/setup.py) egg_info for package BeautifulSoup Installing collected packages: BeautifulSoup Running setup.py install for BeautifulSoup Successfully installed BeautifulSoup Cleaning up...
Ah yes thats the problem, I am using beautifulsoup4==4.3.2. Try pip install beautifulsoup4
Re: Finding the best ticket price – Simple web scraping with Python
#19import 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 Re: Finding the best ticket price – Simple web scraping with Python
#20A 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.t…