Running the script gives this unexpected token error and beautifulsoup error. I've looked at a LOT of guides and none seem to work. This would suggest a problem with my python setup rather than requests or BS. I've just run apt-get remove python
and get-get remove python-pip
, then reinstalled both.
Anyway, the output errors:
$./test.py
import-im6.q16: not authorized `urllib3' @ error/constitute.c/WriteImage/1037.
from: can't read /var/mail/bs4
./test.py: line 3: syntax error near unexpected token `('
./test.py: line 3: `http = urllib3.PoolManager()'
import urllib3
from bs4 import BeautifulSoup
http = urllib3.PoolManager()
r = http.request('GET', 'http://dustyfeet.com')
soup = BeautifulSoup(r.data, 'lxml')
print (soup.title)
print (soup.title.text)